├── .editorconfig ├── .gitattributes ├── .github ├── security.md └── workflows │ └── main.yml ├── .gitignore ├── .npmrc ├── fixtures ├── foo.css ├── foo.js └── foo.txt ├── gulpfile.js ├── index.js ├── license ├── package.json ├── readme.md └── test.js /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | end_of_line = lf 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.yml] 11 | indent_style = space 12 | indent_size = 2 13 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | -------------------------------------------------------------------------------- /.github/security.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. 4 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | - push 4 | - pull_request 5 | jobs: 6 | test: 7 | name: Node.js ${{ matrix.node-version }} 8 | runs-on: ubuntu-latest 9 | strategy: 10 | fail-fast: false 11 | matrix: 12 | node-version: 13 | - 20 14 | - 18 15 | steps: 16 | - uses: actions/checkout@v4 17 | - uses: actions/setup-node@v4 18 | with: 19 | node-version: ${{ matrix.node-version }} 20 | - run: npm install 21 | - run: npm test 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | yarn.lock 3 | dest 4 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | package-lock=false 2 | -------------------------------------------------------------------------------- /fixtures/foo.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sindresorhus/gulp-filter/3d8ce50e741abe3a7e9ef8be06b76dfe65c4a804/fixtures/foo.css -------------------------------------------------------------------------------- /fixtures/foo.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sindresorhus/gulp-filter/3d8ce50e741abe3a7e9ef8be06b76dfe65c4a804/fixtures/foo.js -------------------------------------------------------------------------------- /fixtures/foo.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sindresorhus/gulp-filter/3d8ce50e741abe3a7e9ef8be06b76dfe65c4a804/fixtures/foo.txt -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | import gulp from 'gulp'; 2 | import filter from './index.js'; 3 | 4 | export default function main() { 5 | return gulp.src('fixtures/**/*') 6 | .pipe(filter('**/*.css')) 7 | .pipe(gulp.dest('dest')); 8 | } 9 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import process from 'node:process'; 2 | import path from 'node:path'; 3 | import PluginError from 'plugin-error'; 4 | import multimatch from 'multimatch'; 5 | import streamfilter from 'streamfilter'; 6 | import toAbsoluteGlob from 'to-absolute-glob'; 7 | import slash from 'slash'; 8 | 9 | export default function plugin(pattern, options = {}) { 10 | pattern = typeof pattern === 'string' ? [pattern] : pattern; 11 | 12 | if (!Array.isArray(pattern) && typeof pattern !== 'function') { 13 | throw new PluginError('gulp-filter', '`pattern` should be a string, array, or function'); 14 | } 15 | 16 | // TODO: Use `readableStream.filter()` when targeting Node.js 18. 17 | return streamfilter((file, encoding, callback) => { 18 | let match; 19 | 20 | if (typeof pattern === 'function') { 21 | match = pattern(file); 22 | } else { 23 | const base = path.dirname(file.path); 24 | 25 | let patterns = pattern.map(pattern => { 26 | // Filename only matching glob, prepend full path. 27 | if (!pattern.includes('/')) { 28 | if (pattern[0] === '!') { 29 | return '!' + path.resolve(base, pattern.slice(1)); 30 | } 31 | 32 | return path.resolve(base, pattern); 33 | } 34 | 35 | pattern = toAbsoluteGlob(pattern, {cwd: file.cwd, root: options.root}); 36 | 37 | // Calling `path.resolve` after `toAbsoluteGlob` is required for removing `..` from path. 38 | // This is useful for `../A/B` cases. 39 | if (pattern[0] === '!') { 40 | return '!' + path.resolve(pattern.slice(1)); 41 | } 42 | 43 | return path.resolve(pattern); 44 | }); 45 | 46 | if (process.platform === 'win32') { 47 | patterns = patterns.map(pattern => slash(pattern)); 48 | } 49 | 50 | match = multimatch(path.resolve(file.cwd, file.path), patterns, options).length > 0; 51 | } 52 | 53 | callback(!match); 54 | }, { 55 | objectMode: true, 56 | passthrough: options.passthrough !== false, 57 | restore: options.restore, 58 | }); 59 | } 60 | -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Sindre Sorhus (https://sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gulp-filter", 3 | "version": "9.0.1", 4 | "description": "Filter files in a `vinyl` stream", 5 | "license": "MIT", 6 | "repository": "sindresorhus/gulp-filter", 7 | "funding": "https://github.com/sponsors/sindresorhus", 8 | "author": { 9 | "name": "Sindre Sorhus", 10 | "email": "sindresorhus@gmail.com", 11 | "url": "https://sindresorhus.com" 12 | }, 13 | "type": "module", 14 | "exports": "./index.js", 15 | "sideEffects": false, 16 | "engines": { 17 | "node": ">=18" 18 | }, 19 | "scripts": { 20 | "test": "xo && ava" 21 | }, 22 | "files": [ 23 | "index.js" 24 | ], 25 | "keywords": [ 26 | "gulpplugin", 27 | "filter", 28 | "ignore", 29 | "file", 30 | "files", 31 | "match", 32 | "minimatch", 33 | "glob", 34 | "globbing", 35 | "vinyl" 36 | ], 37 | "dependencies": { 38 | "multimatch": "^7.0.0", 39 | "plugin-error": "^2.0.1", 40 | "slash": "^5.1.0", 41 | "streamfilter": "^3.0.0", 42 | "to-absolute-glob": "^3.0.0" 43 | }, 44 | "devDependencies": { 45 | "ava": "^5.3.1", 46 | "gulp": "^4.0.2", 47 | "p-event": "^6.0.0", 48 | "vinyl": "^3.0.0", 49 | "xo": "^0.56.0" 50 | }, 51 | "peerDependencies": { 52 | "gulp": ">=4" 53 | }, 54 | "peerDependenciesMeta": { 55 | "gulp": { 56 | "optional": true 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # gulp-filter 2 | 3 | > Filter files in a [`vinyl`](https://github.com/gulpjs/vinyl) stream 4 | 5 | Enables you to work on a subset of the original files by filtering them using glob patterns. When you're done and want all the original files back, you just use the `restore` stream. 6 | 7 | ## Install 8 | 9 | ```sh 10 | npm install --save-dev gulp-filter 11 | ``` 12 | 13 | ## Usage 14 | 15 | ### Filter only 16 | 17 | You may want to just filter the stream content: 18 | 19 | ```js 20 | import gulp from 'gulp'; 21 | import uglify from 'gulp-uglify'; 22 | import filter from 'gulp-filter'; 23 | 24 | export default () => { 25 | // Create filter instance inside task function 26 | const f = filter(['**', '!*src/vendor']); 27 | 28 | return gulp.src('src/**/*.js') 29 | // Filter a subset of the files 30 | .pipe(f) 31 | // Run them through a plugin 32 | .pipe(uglify()) 33 | .pipe(gulp.dest('dist')); 34 | }; 35 | ``` 36 | 37 | ### Restoring filtered files 38 | 39 | ```js 40 | import gulp 'gulp'; 41 | import uglify 'gulp-uglify'; 42 | import filter 'gulp-filter'; 43 | 44 | export default () => { 45 | // Create filter instance inside task function 46 | const f = filter(['**', '!*src/vendor'], {restore: true}); 47 | 48 | return gulp.src('src/**/*.js') 49 | // Filter a subset of the files 50 | .pipe(f) 51 | // Run them through a plugin 52 | .pipe(uglify()) 53 | // Bring back the previously filtered out files (optional) 54 | .pipe(f.restore) 55 | .pipe(gulp.dest('dist')); 56 | }; 57 | ``` 58 | 59 | ### Multiple filters 60 | 61 | By combining and restoring different filters you can process different sets of files with a single pipeline. 62 | 63 | ```js 64 | import gulp from 'gulp'; 65 | import less from 'gulp-less'; 66 | import concat from 'gulp-concat'; 67 | import filter from 'gulp-filter'; 68 | 69 | export default () => { 70 | const jsFilter = filter('**/*.js', {restore: true}); 71 | const lessFilter = filter('**/*.less', {restore: true}); 72 | 73 | return gulp.src('assets/**') 74 | .pipe(jsFilter) 75 | .pipe(concat('bundle.js')) 76 | .pipe(jsFilter.restore) 77 | .pipe(lessFilter) 78 | .pipe(less()) 79 | .pipe(lessFilter.restore) 80 | .pipe(gulp.dest('out/')); 81 | }; 82 | ``` 83 | 84 | ### Restore as a file source 85 | 86 | You can restore filtered files in a different place and use it as a standalone source of files (ReadableStream). Setting the `passthrough` option to `false` allows you to do so. 87 | 88 | ```js 89 | import gulp 'gulp'; 90 | import uglify 'gulp-uglify'; 91 | import filter 'gulp-filter'; 92 | 93 | export default () => { 94 | const f = filter(['**', '!*src/vendor'], {restore: true, passthrough: false}); 95 | 96 | const stream = gulp.src('src/**/*.js') 97 | // Filter a subset of the files 98 | .pipe(f) 99 | // Run them through a plugin 100 | .pipe(uglify()) 101 | .pipe(gulp.dest('dist')); 102 | 103 | // Use filtered files as a gulp file source 104 | f.restore.pipe(gulp.dest('vendor-dist')); 105 | 106 | return stream; 107 | }; 108 | ``` 109 | 110 | ## API 111 | 112 | ### filter(pattern, options?) 113 | 114 | Returns a [transform stream](https://nodejs.org/api/stream.html#stream_class_stream_transform) with a [.restore](#optionsrestore) property. 115 | 116 | #### pattern 117 | 118 | Type: `string | string[] | Function` 119 | 120 | Accepts a string/array with globbing patterns which are run through [multimatch](https://github.com/sindresorhus/multimatch). 121 | 122 | If you supply a function, you'll get a [`vinyl` file object](https://github.com/wearefractal/vinyl#file) as the first argument and you're expected to return a boolean of whether to include the file: 123 | 124 | ```js 125 | filter(file => /unicorns/.test(file.path)); 126 | ``` 127 | 128 | #### options 129 | 130 | Type: `object` 131 | 132 | Accepts [`minimatch` options](https://github.com/isaacs/minimatch#options). 133 | 134 | *Note:* Set `dot: true` if you need to match files prefixed with a dot, for example, `.gitignore`. 135 | 136 | ##### restore 137 | 138 | Type: `boolean`\ 139 | Default: `false` 140 | 141 | Restore filtered files. 142 | 143 | ##### passthrough 144 | 145 | Type: `boolean`\ 146 | Default: `true` 147 | 148 | When set to `true`, filtered files are restored with a `stream.PassThrough`, otherwise, when set to `false`, filtered files are restored as a `stram.Readable`. 149 | 150 | When the stream is a `stream.Readable`, it ends by itself, but when it's `stream.PassThrough`, you are responsible of ending the stream. 151 | -------------------------------------------------------------------------------- /test.js: -------------------------------------------------------------------------------- 1 | import {fileURLToPath} from 'node:url'; 2 | import path from 'node:path'; 3 | import {Readable} from 'node:stream'; 4 | import test from 'ava'; 5 | import {pEvent} from 'p-event'; 6 | import Vinyl from 'vinyl'; 7 | import filter from './index.js'; 8 | 9 | const __dirname = path.dirname(fileURLToPath(import.meta.url)); 10 | 11 | test('filter', async t => { 12 | const stream = filter('included.js'); 13 | stream.write(new Vinyl({ 14 | base: __dirname, 15 | path: path.join(__dirname, 'included.js'), 16 | })); 17 | stream.write(new Vinyl({ 18 | base: __dirname, 19 | path: path.join(__dirname, 'ignored.js'), 20 | })); 21 | stream.end(); 22 | 23 | const data = await pEvent(stream, 'data'); 24 | t.is(data.relative, 'included.js'); 25 | }); 26 | 27 | test('filter with restore set to false', async t => { 28 | const stream = filter('included.js', {restore: false}); 29 | stream.write(new Vinyl({ 30 | base: __dirname, 31 | path: path.join(__dirname, 'included.js'), 32 | })); 33 | stream.write(new Vinyl({ 34 | base: __dirname, 35 | path: path.join(__dirname, 'ignored.js'), 36 | })); 37 | stream.end(); 38 | 39 | const data = await pEvent(stream, 'data'); 40 | t.is(data.relative, 'included.js'); 41 | }); 42 | 43 | test('forward multimatch options', async t => { 44 | const stream = filter('*.js', {matchBase: true}); 45 | stream.write(new Vinyl({ 46 | base: __dirname, 47 | path: path.join(__dirname, 'nested', 'resource.js'), 48 | })); 49 | stream.write(new Vinyl({ 50 | base: __dirname, 51 | path: path.join(__dirname, 'nested', 'resource.css'), 52 | })); 53 | stream.end(); 54 | 55 | const data = await pEvent(stream, 'data'); 56 | t.is(data.relative, path.join('nested', 'resource.js')); 57 | }); 58 | 59 | test('filter using a function', async t => { 60 | const stream = filter(file => file.path === 'included.js'); 61 | stream.write(new Vinyl({path: 'included.js'})); 62 | stream.write(new Vinyl({path: 'ignored.js'})); 63 | stream.end(); 64 | 65 | const data = await pEvent(stream, 'data'); 66 | t.is(data.path, 'included.js'); 67 | }); 68 | 69 | test('filter files with negate pattern and leading dot', async t => { 70 | const stream = filter(['*', '!*.json', '!*rc'], {dot: true}); 71 | stream.write(new Vinyl({path: 'included.js'})); 72 | stream.write(new Vinyl({path: 'package.json'})); 73 | stream.write(new Vinyl({path: '.jshintrc'})); 74 | stream.write(new Vinyl({path: 'app.js'})); 75 | stream.end(); 76 | 77 | const data = await pEvent(stream, 'data'); 78 | t.is(data.path, 'included.js'); 79 | }); 80 | 81 | test('filter with respect to current working directory', async t => { 82 | const stream = filter('test/**/*.js'); 83 | stream.write(new Vinyl({ 84 | base: path.join(__dirname, 'test'), 85 | path: path.join(__dirname, 'test', 'included.js'), 86 | })); 87 | stream.write(new Vinyl({ 88 | base: __dirname, 89 | path: path.join(__dirname, 'ignored.js'), 90 | })); 91 | stream.end(); 92 | 93 | const data = await pEvent(stream, 'data'); 94 | t.is(data.relative, 'included.js'); 95 | }); 96 | 97 | test('filter.restore - bring back the previously filtered files', async t => { 98 | const stream = filter('*.json', {restore: true}); 99 | const completeStream = stream.pipe(stream.restore); 100 | stream.write(new Vinyl({path: 'package.json'})); 101 | stream.write(new Vinyl({path: 'app.js'})); 102 | stream.write(new Vinyl({path: 'package2.json'})); 103 | stream.end(); 104 | 105 | const data = await pEvent(completeStream, 'data'); 106 | t.is(data.path, 'package.json'); 107 | }); 108 | 109 | test('filter.restore - work when using multiple filters', async t => { 110 | const streamFilter1 = filter(['*.js'], {restore: true}); 111 | const streamFilter2 = filter(['*.json'], {restore: true}); 112 | const completeStream = streamFilter1 113 | .pipe(streamFilter2) 114 | .pipe(streamFilter1.restore) 115 | .pipe(streamFilter2.restore); 116 | streamFilter1.write(new Vinyl({path: 'package.json'})); 117 | streamFilter1.write(new Vinyl({path: 'app.js'})); 118 | streamFilter1.write(new Vinyl({path: 'main.css'})); 119 | streamFilter1.end(); 120 | 121 | const data = await pEvent(completeStream, 'data'); 122 | t.is(data.path, 'package.json'); 123 | }); 124 | 125 | test('filter.restore - end when not using the passthrough option', async t => { 126 | const stream = filter('*.json', {restore: true, passthrough: false}); 127 | const restoreStream = stream.restore; 128 | stream.write(new Vinyl({path: 'package.json'})); 129 | stream.write(new Vinyl({path: 'app.js'})); 130 | stream.write(new Vinyl({path: 'package2.json'})); 131 | stream.end(); 132 | 133 | const data = await pEvent(restoreStream, 'data'); 134 | t.is(data.path, 'app.js'); 135 | }); 136 | 137 | test('filter.restore - not end before the restore stream didn\'t end', async t => { 138 | const stream = filter('*.json', {restore: true}); 139 | const restoreStream = stream.restore; 140 | stream.write(new Vinyl({path: 'package.json'})); 141 | stream.write(new Vinyl({path: 'app.js'})); 142 | stream.end(); 143 | 144 | const data = await pEvent(restoreStream, 'data'); 145 | t.is(data.path, 'app.js'); 146 | }); 147 | 148 | test('filter.restore - pass files as they come', async t => { 149 | const stream = filter('*.json', {restore: true}); 150 | const restoreStream = stream.restore; 151 | stream.pipe(restoreStream); 152 | stream.write(new Vinyl({path: 'package.json'})); 153 | stream.write(new Vinyl({path: 'app.js'})); 154 | stream.write(new Vinyl({path: 'package2.json'})); 155 | stream.write(new Vinyl({path: 'app2.js'})); 156 | stream.end(); 157 | 158 | const data = await pEvent(restoreStream, 'data'); 159 | t.is(data.path, 'package.json'); 160 | }); 161 | 162 | test('filter.restore - work when restore stream is not used', async t => { 163 | t.plan(1); 164 | 165 | const stream = filter('*.json'); 166 | for (let index = 0; index < stream._writableState.highWaterMark + 1; index++) { 167 | stream.write(new Vinyl({path: 'nonmatch.js'})); 168 | } 169 | 170 | const finish = pEvent(stream, 'finish'); 171 | stream.end(); 172 | await finish; 173 | t.pass(); 174 | }); 175 | 176 | test('path matching', async t => { 177 | const testFilesPaths = [ 178 | '/test.js', 179 | '/A/test.js', 180 | '/A/C/test.js', 181 | '/A/B/test.js', 182 | '/A/B/C/test.js', 183 | '/A/B/C/d.js', 184 | ]; 185 | 186 | const testFiles = testFilesPaths.map(filePath => new Vinyl({cwd: '/A/B', path: filePath})); 187 | 188 | const testCases = [ 189 | { 190 | description: 'Filename by suffix', 191 | pattern: ['*.js'], 192 | expectedFiles: testFiles, 193 | }, 194 | { 195 | description: 'Filename by suffix, excluding d.js', 196 | pattern: ['*.js', '!d.js'], 197 | expectedFiles: testFiles.slice(0, -1), 198 | }, 199 | { 200 | description: 'Absolute filter by suffix', 201 | pattern: ['/**/*.js'], 202 | expectedFiles: testFiles, 203 | }, 204 | { 205 | description: 'Absolute filter by suffix with prefix', 206 | pattern: ['/A/**/*.js'], 207 | expectedFiles: testFiles.slice(1), 208 | }, 209 | { 210 | description: 'Absolute filter by suffix with prefix equal to base', 211 | pattern: ['/A/B/**/*.js'], 212 | expectedFiles: testFiles.slice(3), 213 | }, 214 | { 215 | description: 'Relative filter', 216 | pattern: ['**/*.js'], 217 | expectedFiles: testFiles.slice(3), 218 | }, 219 | { 220 | description: 'Relative filter but explicit', 221 | pattern: ['./**/*.js'], 222 | expectedFiles: testFiles.slice(3), 223 | }, 224 | { 225 | description: 'Relative filter with .. prefix', 226 | pattern: ['../**/*.js'], 227 | expectedFiles: testFiles.slice(1), 228 | }, 229 | { 230 | description: 'Relative filter with path prefix', 231 | pattern: ['C/**/*.js'], 232 | expectedFiles: testFiles.slice(4), 233 | }, 234 | { 235 | description: 'Relative filter with path prefix, but then ..', 236 | pattern: ['C/../**/*.js'], 237 | expectedFiles: testFiles.slice(3), 238 | }, 239 | { 240 | description: 'Absolute filter starting with !', 241 | pattern: ['/**/*', '!/**/*.js'], 242 | expectedFiles: [], 243 | }, 244 | { 245 | description: 'Absolute filter starting with !, filters out all test.js', 246 | pattern: ['/**/*', '!/**/test.js'], 247 | expectedFiles: [testFiles[5]], 248 | }, 249 | { 250 | description: 'Absolute filter starting with !, . omitted', 251 | pattern: ['/**/*', '!**/*.js'], 252 | expectedFiles: testFiles.slice(0, 3), 253 | }, 254 | { 255 | description: 'Relative filter starting with !, with .', 256 | pattern: ['/**/*', '!./**/*.js'], 257 | expectedFiles: testFiles.slice(0, 3), 258 | }, 259 | { 260 | description: 'Mixed filters: absolute filter take files, when absolute negated filter rejects', 261 | pattern: ['/A/**/*.js', '!/A/B/**/*.js'], 262 | expectedFiles: testFiles.slice(1, 3), 263 | }, 264 | { 265 | description: 'Mixed filters: relative filter take files, when absolute negated filter rejects', 266 | pattern: ['**/*.js', '!/A/B/C/**/*.js'], 267 | expectedFiles: testFiles.slice(3, 4), 268 | }, 269 | { 270 | description: 'Mixed filters: absolute filter take files, when relative negated filter rejects', 271 | pattern: ['/A/**/*.js', '!./C/**/*.js'], 272 | expectedFiles: testFiles.slice(1, 4), 273 | }, 274 | { 275 | description: 'Mixed filters: relative filter take files, when relative negated filter rejects', 276 | pattern: ['**/*.js', '!./C/**/*.js'], 277 | expectedFiles: testFiles.slice(3, 4), 278 | }, 279 | ]; 280 | 281 | for (const testCase of testCases) { 282 | const stream = filter(testCase.pattern); 283 | const promise = Readable.from(stream).toArray(); 284 | 285 | for (const testFile of testFiles) { 286 | stream.write(testFile); 287 | } 288 | 289 | stream.end(); 290 | 291 | const files = await promise; // eslint-disable-line no-await-in-loop 292 | t.deepEqual(files.map(file => file.path), testCase.expectedFiles.map(file => file.path)); 293 | } 294 | }); 295 | --------------------------------------------------------------------------------