mirror of
https://github.com/immich-app/immich.git
synced 2025-01-01 08:31:59 +00:00
add tests for cli exclusion pattern (#6148)
This commit is contained in:
parent
13fb32513c
commit
ee82327d2a
1 changed files with 52 additions and 0 deletions
|
@ -198,6 +198,58 @@ const tests: Test[] = [
|
|||
[`/photos/3.jpg`]: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
test: 'should support ignoring full filename',
|
||||
options: {
|
||||
pathsToCrawl: ['/photos'],
|
||||
exclusionPatterns: ['**/image2.jpg'],
|
||||
},
|
||||
files: {
|
||||
'/photos/image1.jpg': true,
|
||||
'/photos/image2.jpg': false,
|
||||
'/photos/image3.jpg': true,
|
||||
},
|
||||
},
|
||||
{
|
||||
test: 'should support ignoring file extensions',
|
||||
options: {
|
||||
pathsToCrawl: ['/photos'],
|
||||
exclusionPatterns: ['**/*.png'],
|
||||
},
|
||||
files: {
|
||||
'/photos/image1.jpg': true,
|
||||
'/photos/image2.png': false,
|
||||
'/photos/image3.jpg': true,
|
||||
},
|
||||
},
|
||||
{
|
||||
test: 'should support ignoring folder names',
|
||||
options: {
|
||||
pathsToCrawl: ['/photos'],
|
||||
recursive: true,
|
||||
exclusionPatterns: ['**/raw/**'],
|
||||
},
|
||||
files: {
|
||||
'/photos/image1.jpg': true,
|
||||
'/photos/image/image1.jpg': true,
|
||||
'/photos/raw/image2.dng': false,
|
||||
'/photos/raw/image3.dng': false,
|
||||
'/photos/notraw/image3.jpg': true,
|
||||
},
|
||||
},
|
||||
{
|
||||
test: 'should support ignoring absolute paths',
|
||||
options: {
|
||||
pathsToCrawl: ['/'],
|
||||
recursive: true,
|
||||
exclusionPatterns: ['/images/**'],
|
||||
},
|
||||
files: {
|
||||
'/photos/image1.jpg': true,
|
||||
'/images/image2.jpg': false,
|
||||
'/assets/image3.jpg': true,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
describe(CrawlService.name, () => {
|
||||
|
|
Loading…
Reference in a new issue