From 6d71385ad8940434f75c0961e08430d50fd0fb81 Mon Sep 17 00:00:00 2001 From: pralkarz <31964869+pralkarz@users.noreply.github.com> Date: Sun, 9 Feb 2025 23:05:10 +0100 Subject: [PATCH 1/9] Ported test suite: patterns --- package-lock.json | 14 +-- package.json | 2 +- src/index.ts | 2 +- .../[...with-square-brackets-and-dots].js | 4 + .../square-brackets/[with-square-brackets].js | 4 + test/__fixtures__/patterns/directory/file.js | 1 + .../nested-directory/nested-directory-file.js | 1 + .../patterns/file.will-never-support | 0 .../patterns/node_modules/node-module.js | 1 + .../patterns/other-directory/file.js | 1 + .../nested-directory/nested-directory-file.js | 1 + .../patterns/other-regular-modules.js | 1 + test/__fixtures__/patterns/regular-module.js | 1 + .../error-on-unmatched-pattern.js.snap | 2 +- .../__snapshots__/ignore-unknown.js.snap | 4 +- test/__tests__/__snapshots__/patterns.js.snap | 82 ++++++++++++++ test/__tests__/patterns.js | 101 ++++++++++++++++++ 17 files changed, 210 insertions(+), 12 deletions(-) create mode 100644 test/__fixtures__/patterns-special-characters/dots/[...with-square-brackets-and-dots].js create mode 100644 test/__fixtures__/patterns-special-characters/square-brackets/[with-square-brackets].js create mode 100644 test/__fixtures__/patterns/directory/file.js create mode 100644 test/__fixtures__/patterns/directory/nested-directory/nested-directory-file.js create mode 100644 test/__fixtures__/patterns/file.will-never-support create mode 100644 test/__fixtures__/patterns/node_modules/node-module.js create mode 100644 test/__fixtures__/patterns/other-directory/file.js create mode 100644 test/__fixtures__/patterns/other-directory/nested-directory/nested-directory-file.js create mode 100644 test/__fixtures__/patterns/other-regular-modules.js create mode 100644 test/__fixtures__/patterns/regular-module.js create mode 100644 test/__tests__/__snapshots__/patterns.js.snap create mode 100644 test/__tests__/patterns.js diff --git a/package-lock.json b/package-lock.json index 1f883cb..69bd323 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,7 @@ "specialist": "^1.4.5", "tiny-editorconfig": "^1.0.0", "tiny-jsonc": "^1.0.1", - "tiny-readdir-glob": "^1.22.24", + "tiny-readdir-glob": "^1.23.0", "tiny-spinner": "^2.0.4", "worktank": "^2.7.3", "zeptomatch": "^2.0.0", @@ -5779,9 +5779,9 @@ } }, "node_modules/tiny-readdir-glob": { - "version": "1.22.24", - "resolved": "https://registry.npmjs.org/tiny-readdir-glob/-/tiny-readdir-glob-1.22.24.tgz", - "integrity": "sha512-HPDNMin7GoyPMesJNkAeT0ERU51ZWFby2RXEE2MHeVeO4c0i07679cuEMKzhKNBlBrBKoVjOmaie5y+FnRwL8g==", + "version": "1.23.0", + "resolved": "https://registry.npmjs.org/tiny-readdir-glob/-/tiny-readdir-glob-1.23.0.tgz", + "integrity": "sha512-ElwCbSNP9ElOsrxGHieDswd27w/72JyyrlMyFsP/hAA/xEZbt8euWTEunxQ6bapfiCtGW799Ip0I4HnQ+ZPd6g==", "dependencies": { "tiny-readdir": "^2.7.0", "zeptomatch": "^1.2.2", @@ -10580,9 +10580,9 @@ } }, "tiny-readdir-glob": { - "version": "1.22.24", - "resolved": "https://registry.npmjs.org/tiny-readdir-glob/-/tiny-readdir-glob-1.22.24.tgz", - "integrity": "sha512-HPDNMin7GoyPMesJNkAeT0ERU51ZWFby2RXEE2MHeVeO4c0i07679cuEMKzhKNBlBrBKoVjOmaie5y+FnRwL8g==", + "version": "1.23.0", + "resolved": "https://registry.npmjs.org/tiny-readdir-glob/-/tiny-readdir-glob-1.23.0.tgz", + "integrity": "sha512-ElwCbSNP9ElOsrxGHieDswd27w/72JyyrlMyFsP/hAA/xEZbt8euWTEunxQ6bapfiCtGW799Ip0I4HnQ+ZPd6g==", "requires": { "tiny-readdir": "^2.7.0", "zeptomatch": "^1.2.2", diff --git a/package.json b/package.json index 3e8a507..e8992ab 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "specialist": "^1.4.5", "tiny-editorconfig": "^1.0.0", "tiny-jsonc": "^1.0.1", - "tiny-readdir-glob": "^1.22.24", + "tiny-readdir-glob": "^1.23.0", "tiny-spinner": "^2.0.4", "worktank": "^2.7.3", "zeptomatch": "^2.0.0", diff --git a/src/index.ts b/src/index.ts index 11cc15c..b3f8541 100644 --- a/src/index.ts +++ b/src/index.ts @@ -200,7 +200,7 @@ async function runGlobs(options: Options, pluginsDefaultOptions: PluginsOptions, if (!totalMatched && !totalIgnored) { if (options.errorOnUnmatchedPattern) { - stderr.prefixed.error(`No files matching the given patterns were found`); + stderr.prefixed.error(`No files matching the given patterns were found.`); } } diff --git a/test/__fixtures__/patterns-special-characters/dots/[...with-square-brackets-and-dots].js b/test/__fixtures__/patterns-special-characters/dots/[...with-square-brackets-and-dots].js new file mode 100644 index 0000000..ad47336 --- /dev/null +++ b/test/__fixtures__/patterns-special-characters/dots/[...with-square-brackets-and-dots].js @@ -0,0 +1,4 @@ +foo( + + +) diff --git a/test/__fixtures__/patterns-special-characters/square-brackets/[with-square-brackets].js b/test/__fixtures__/patterns-special-characters/square-brackets/[with-square-brackets].js new file mode 100644 index 0000000..ad47336 --- /dev/null +++ b/test/__fixtures__/patterns-special-characters/square-brackets/[with-square-brackets].js @@ -0,0 +1,4 @@ +foo( + + +) diff --git a/test/__fixtures__/patterns/directory/file.js b/test/__fixtures__/patterns/directory/file.js new file mode 100644 index 0000000..ad9a93a --- /dev/null +++ b/test/__fixtures__/patterns/directory/file.js @@ -0,0 +1 @@ +'use strict'; diff --git a/test/__fixtures__/patterns/directory/nested-directory/nested-directory-file.js b/test/__fixtures__/patterns/directory/nested-directory/nested-directory-file.js new file mode 100644 index 0000000..ad9a93a --- /dev/null +++ b/test/__fixtures__/patterns/directory/nested-directory/nested-directory-file.js @@ -0,0 +1 @@ +'use strict'; diff --git a/test/__fixtures__/patterns/file.will-never-support b/test/__fixtures__/patterns/file.will-never-support new file mode 100644 index 0000000..e69de29 diff --git a/test/__fixtures__/patterns/node_modules/node-module.js b/test/__fixtures__/patterns/node_modules/node-module.js new file mode 100644 index 0000000..ad9a93a --- /dev/null +++ b/test/__fixtures__/patterns/node_modules/node-module.js @@ -0,0 +1 @@ +'use strict'; diff --git a/test/__fixtures__/patterns/other-directory/file.js b/test/__fixtures__/patterns/other-directory/file.js new file mode 100644 index 0000000..ad9a93a --- /dev/null +++ b/test/__fixtures__/patterns/other-directory/file.js @@ -0,0 +1 @@ +'use strict'; diff --git a/test/__fixtures__/patterns/other-directory/nested-directory/nested-directory-file.js b/test/__fixtures__/patterns/other-directory/nested-directory/nested-directory-file.js new file mode 100644 index 0000000..ad9a93a --- /dev/null +++ b/test/__fixtures__/patterns/other-directory/nested-directory/nested-directory-file.js @@ -0,0 +1 @@ +'use strict'; diff --git a/test/__fixtures__/patterns/other-regular-modules.js b/test/__fixtures__/patterns/other-regular-modules.js new file mode 100644 index 0000000..ad9a93a --- /dev/null +++ b/test/__fixtures__/patterns/other-regular-modules.js @@ -0,0 +1 @@ +'use strict'; diff --git a/test/__fixtures__/patterns/regular-module.js b/test/__fixtures__/patterns/regular-module.js new file mode 100644 index 0000000..ad9a93a --- /dev/null +++ b/test/__fixtures__/patterns/regular-module.js @@ -0,0 +1 @@ +'use strict'; diff --git a/test/__tests__/__snapshots__/error-on-unmatched-pattern.js.snap b/test/__tests__/__snapshots__/error-on-unmatched-pattern.js.snap index ab48a0c..327d815 100644 --- a/test/__tests__/__snapshots__/error-on-unmatched-pattern.js.snap +++ b/test/__tests__/__snapshots__/error-on-unmatched-pattern.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`error on unmatched pattern (stderr) 1`] = `"[error] No files matching the given patterns were found"`; +exports[`error on unmatched pattern (stderr) 1`] = `"[error] No files matching the given patterns were found."`; exports[`error on unmatched pattern (stdout) 1`] = `""`; diff --git a/test/__tests__/__snapshots__/ignore-unknown.js.snap b/test/__tests__/__snapshots__/ignore-unknown.js.snap index 02de4fb..247fef9 100644 --- a/test/__tests__/__snapshots__/ignore-unknown.js.snap +++ b/test/__tests__/__snapshots__/ignore-unknown.js.snap @@ -6,13 +6,13 @@ exports[`Ignored file (stdout) 1`] = `""`; exports[`Ignored file (write) 1`] = `[]`; -exports[`None exist file (stderr) 1`] = `"[error] No files matching the given patterns were found"`; +exports[`None exist file (stderr) 1`] = `"[error] No files matching the given patterns were found."`; exports[`None exist file (stdout) 1`] = `""`; exports[`None exist file (write) 1`] = `[]`; -exports[`Not matching pattern (stderr) 1`] = `"[error] No files matching the given patterns were found"`; +exports[`Not matching pattern (stderr) 1`] = `"[error] No files matching the given patterns were found."`; exports[`Not matching pattern (stdout) 1`] = `""`; diff --git a/test/__tests__/__snapshots__/patterns.js.snap b/test/__tests__/__snapshots__/patterns.js.snap new file mode 100644 index 0000000..d2bc8ff --- /dev/null +++ b/test/__tests__/__snapshots__/patterns.js.snap @@ -0,0 +1,82 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`exits with an informative message when there are no patterns provided (stderr) 1`] = ` +" + Expected at least one target file/dir/glob +" +`; + +exports[`exits with an informative message when there are no patterns provided (stdout) 1`] = `""`; + +exports[`exits with an informative message when there are no patterns provided (write) 1`] = `[]`; + +exports[`multiple patterns (stderr) 1`] = `""`; + +exports[`multiple patterns (stdout) 1`] = ` +"directory/file.js +directory/nested-directory/nested-directory-file.js +other-directory/file.js +other-directory/nested-directory/nested-directory-file.js" +`; + +exports[`multiple patterns (write) 1`] = `[]`; + +exports[`multiple patterns with a negated pattern (stderr) 1`] = `""`; + +exports[`multiple patterns with a negated pattern (stdout) 1`] = ` +"directory/file.js +other-directory/file.js +other-regular-modules.js +regular-module.js" +`; + +exports[`multiple patterns with a negated pattern (write) 1`] = `[]`; + +exports[`multiple patterns with a negated pattern and leading \`./\`, ignores node_modules by default (stderr) 1`] = `""`; + +exports[`multiple patterns with a negated pattern and leading \`./\`, ignores node_modules by default (stdout) 1`] = ` +"other-directory/file.js +other-directory/nested-directory/nested-directory-file.js +other-regular-modules.js +regular-module.js" +`; + +exports[`multiple patterns with a negated pattern and leading \`./\`, ignores node_modules by default (write) 1`] = `[]`; + +exports[`multiple patterns with a negated pattern, doesn't ignore node_modules with the --with-node-modules flag (stderr) 1`] = `""`; + +exports[`multiple patterns with a negated pattern, doesn't ignore node_modules with the --with-node-modules flag (stdout) 1`] = ` +"node_modules/node-module.js +other-directory/file.js +other-directory/nested-directory/nested-directory-file.js +other-regular-modules.js +regular-module.js" +`; + +exports[`multiple patterns with a negated pattern, doesn't ignore node_modules with the --with-node-modules flag (write) 1`] = `[]`; + +exports[`multiple patterns with a negated pattern, ignores node_modules by default (stderr) 1`] = `""`; + +exports[`multiple patterns with a negated pattern, ignores node_modules by default (stdout) 1`] = ` +"other-directory/file.js +other-directory/nested-directory/nested-directory-file.js +other-regular-modules.js +regular-module.js" +`; + +exports[`multiple patterns with a negated pattern, ignores node_modules by default (write) 1`] = `[]`; + +exports[`multiple patterns with an extra non-existent pattern (stderr) 1`] = `""`; + +exports[`multiple patterns with an extra non-existent pattern (stdout) 1`] = ` +"directory/file.js +directory/nested-directory/nested-directory-file.js" +`; + +exports[`multiple patterns with an extra non-existent pattern (write) 1`] = `[]`; + +exports[`multiple patterns, throws an error and exits with a non-zero code when there are no matches (stderr) 1`] = `"[error] No files matching the given patterns were found."`; + +exports[`multiple patterns, throws an error and exits with a non-zero code when there are no matches (stdout) 1`] = `""`; + +exports[`multiple patterns, throws an error and exits with a non-zero code when there are no matches (write) 1`] = `[]`; diff --git a/test/__tests__/patterns.js b/test/__tests__/patterns.js new file mode 100644 index 0000000..db1243e --- /dev/null +++ b/test/__tests__/patterns.js @@ -0,0 +1,101 @@ +import { runCli } from "../utils"; + +describe("multiple patterns", () => { + runCli("patterns", [ + "directory/**/*.js", + "other-directory/**/*.js", + "-l", + ]).test({ + status: 1, + }); +}); + +describe("multiple patterns with an extra non-existent pattern", () => { + runCli("patterns", [ + "directory/**/*.js", + "non-existent.js", + "-l", + ]).test({ + status: 1, + }); +}); + +describe("multiple patterns with a negated pattern", () => { + runCli("patterns", [ + "**/*.js", + "!**/nested-directory/**", + "-l", + ]).test({ + status: 1, + }); +}); + +describe("multiple patterns with a negated pattern, ignores node_modules by default", () => { + runCli("patterns", [ + "**/*.js", + "!directory/**", + "-l", + ]).test({ + status: 1, + }); +}); + +// TODO: Handle leading `./` and `../` in patterns. +describe.skip("multiple patterns with a negated pattern and leading `./`, ignores node_modules by default", () => { + runCli("patterns", [ + "./**/*.js", + "!./directory/**", + "-l", + ]).test({ + status: 1, + }); +}); + +describe("multiple patterns with a negated pattern, doesn't ignore node_modules with the --with-node-modules flag", () => { + runCli("patterns", [ + "**/*.js", + "!directory/**", + "-l", + "--with-node-modules", + ]).test({ + status: 1, + }); +}); + +describe("exits with an informative message when there are no patterns provided", () => { + runCli("patterns").test({ + status: 1, + }); +}); + +describe("multiple patterns, throws an error and exits with a non-zero code when there are no matches", () => { + runCli("patterns", [ + "non-existent.js", + "other-non-existent.js", + "-l", + ]).test({ + status: 1, + }); +}); + +describe("file names with special characters", () => { + runCli("patterns-special-characters/square-brackets", [ + "[with-square-brackets].js", + "-l", + ]).test({ + status: 1, + write: [], + stderr: "", + stdout: "[with-square-brackets].js", + }); + + runCli("patterns-special-characters/dots", [ + "[...with-square-brackets-and-dots].js", + "-l", + ]).test({ + status: 1, + write: [], + stderr: "", + stdout: "[...with-square-brackets-and-dots].js", + }); +}); From 2725a5a051f0a47575bedfdea35e53b56f081bef Mon Sep 17 00:00:00 2001 From: pralkarz Date: Mon, 10 Feb 2025 12:11:05 +0100 Subject: [PATCH 2/9] Copy the v3 test files as is Test file: https://github.com/prettier/prettier/blob/92ac6d036e5b226441584e9f48876ae2f7c6a6a1/tests/integration/__tests__/patterns-glob.js Fixtures: https://github.com/prettier/prettier/tree/92ac6d036e5b226441584e9f48876ae2f7c6a6a1/tests/integration/cli/patterns-glob Snapshots: https://github.com/prettier/prettier/blob/92ac6d036e5b226441584e9f48876ae2f7c6a6a1/tests/integration/__tests__/__snapshots__/patterns-glob.js.snap --- .../patterns-glob/fixtures-1/!file.js | 2 + .../patterns-glob/fixtures-1/a.js | 2 + .../patterns-glob/fixtures-1/b.js | 2 + .../patterns-glob/fixtures-2/!b.js | 2 + .../patterns-glob/fixtures-2/!dir.js/1.css | 2 + .../patterns-glob/fixtures-2/!dir.js/2.css | 2 + .../patterns-glob/fixtures-2/a.js | 2 + .../fixtures-3/dir/.svn/in-svn.js | 2 + .../patterns-glob/fixtures-3/dir/inside.js | 2 + .../dir/node_modules/in-node-modules.js | 2 + .../patterns-glob/fixtures-3/outside.js | 2 + .../patterns-glob/fixtures-4/0/1/2/level-3.js | 2 + .../patterns-glob/fixtures-4/0/1/level-2.js | 2 + .../patterns-glob/fixtures-4/0/level-1.js | 2 + .../patterns-glob/fixtures-4/level-0.js | 2 + .../constructor/should-be-formatted.js | 1 + .../__snapshots__/patterns-glob.js.snap | 101 +++++++++++++++ test/__tests__/patterns-glob.js | 115 ++++++++++++++++++ 18 files changed, 247 insertions(+) create mode 100644 test/__fixtures__/patterns-glob/fixtures-1/!file.js create mode 100644 test/__fixtures__/patterns-glob/fixtures-1/a.js create mode 100644 test/__fixtures__/patterns-glob/fixtures-1/b.js create mode 100644 test/__fixtures__/patterns-glob/fixtures-2/!b.js create mode 100644 test/__fixtures__/patterns-glob/fixtures-2/!dir.js/1.css create mode 100644 test/__fixtures__/patterns-glob/fixtures-2/!dir.js/2.css create mode 100644 test/__fixtures__/patterns-glob/fixtures-2/a.js create mode 100644 test/__fixtures__/patterns-glob/fixtures-3/dir/.svn/in-svn.js create mode 100644 test/__fixtures__/patterns-glob/fixtures-3/dir/inside.js create mode 100644 test/__fixtures__/patterns-glob/fixtures-3/dir/node_modules/in-node-modules.js create mode 100644 test/__fixtures__/patterns-glob/fixtures-3/outside.js create mode 100644 test/__fixtures__/patterns-glob/fixtures-4/0/1/2/level-3.js create mode 100644 test/__fixtures__/patterns-glob/fixtures-4/0/1/level-2.js create mode 100644 test/__fixtures__/patterns-glob/fixtures-4/0/level-1.js create mode 100644 test/__fixtures__/patterns-glob/fixtures-4/level-0.js create mode 100644 test/__fixtures__/patterns-glob/fixtures-5/constructor/should-be-formatted.js create mode 100644 test/__tests__/__snapshots__/patterns-glob.js.snap create mode 100644 test/__tests__/patterns-glob.js diff --git a/test/__fixtures__/patterns-glob/fixtures-1/!file.js b/test/__fixtures__/patterns-glob/fixtures-1/!file.js new file mode 100644 index 0000000..0b118ad --- /dev/null +++ b/test/__fixtures__/patterns-glob/fixtures-1/!file.js @@ -0,0 +1,2 @@ +foo. +bar() diff --git a/test/__fixtures__/patterns-glob/fixtures-1/a.js b/test/__fixtures__/patterns-glob/fixtures-1/a.js new file mode 100644 index 0000000..0b118ad --- /dev/null +++ b/test/__fixtures__/patterns-glob/fixtures-1/a.js @@ -0,0 +1,2 @@ +foo. +bar() diff --git a/test/__fixtures__/patterns-glob/fixtures-1/b.js b/test/__fixtures__/patterns-glob/fixtures-1/b.js new file mode 100644 index 0000000..0b118ad --- /dev/null +++ b/test/__fixtures__/patterns-glob/fixtures-1/b.js @@ -0,0 +1,2 @@ +foo. +bar() diff --git a/test/__fixtures__/patterns-glob/fixtures-2/!b.js b/test/__fixtures__/patterns-glob/fixtures-2/!b.js new file mode 100644 index 0000000..0b118ad --- /dev/null +++ b/test/__fixtures__/patterns-glob/fixtures-2/!b.js @@ -0,0 +1,2 @@ +foo. +bar() diff --git a/test/__fixtures__/patterns-glob/fixtures-2/!dir.js/1.css b/test/__fixtures__/patterns-glob/fixtures-2/!dir.js/1.css new file mode 100644 index 0000000..687c7f1 --- /dev/null +++ b/test/__fixtures__/patterns-glob/fixtures-2/!dir.js/1.css @@ -0,0 +1,2 @@ +.foo +{} diff --git a/test/__fixtures__/patterns-glob/fixtures-2/!dir.js/2.css b/test/__fixtures__/patterns-glob/fixtures-2/!dir.js/2.css new file mode 100644 index 0000000..687c7f1 --- /dev/null +++ b/test/__fixtures__/patterns-glob/fixtures-2/!dir.js/2.css @@ -0,0 +1,2 @@ +.foo +{} diff --git a/test/__fixtures__/patterns-glob/fixtures-2/a.js b/test/__fixtures__/patterns-glob/fixtures-2/a.js new file mode 100644 index 0000000..0b118ad --- /dev/null +++ b/test/__fixtures__/patterns-glob/fixtures-2/a.js @@ -0,0 +1,2 @@ +foo. +bar() diff --git a/test/__fixtures__/patterns-glob/fixtures-3/dir/.svn/in-svn.js b/test/__fixtures__/patterns-glob/fixtures-3/dir/.svn/in-svn.js new file mode 100644 index 0000000..11d7772 --- /dev/null +++ b/test/__fixtures__/patterns-glob/fixtures-3/dir/.svn/in-svn.js @@ -0,0 +1,2 @@ +foo +.bar() diff --git a/test/__fixtures__/patterns-glob/fixtures-3/dir/inside.js b/test/__fixtures__/patterns-glob/fixtures-3/dir/inside.js new file mode 100644 index 0000000..11d7772 --- /dev/null +++ b/test/__fixtures__/patterns-glob/fixtures-3/dir/inside.js @@ -0,0 +1,2 @@ +foo +.bar() diff --git a/test/__fixtures__/patterns-glob/fixtures-3/dir/node_modules/in-node-modules.js b/test/__fixtures__/patterns-glob/fixtures-3/dir/node_modules/in-node-modules.js new file mode 100644 index 0000000..11d7772 --- /dev/null +++ b/test/__fixtures__/patterns-glob/fixtures-3/dir/node_modules/in-node-modules.js @@ -0,0 +1,2 @@ +foo +.bar() diff --git a/test/__fixtures__/patterns-glob/fixtures-3/outside.js b/test/__fixtures__/patterns-glob/fixtures-3/outside.js new file mode 100644 index 0000000..11d7772 --- /dev/null +++ b/test/__fixtures__/patterns-glob/fixtures-3/outside.js @@ -0,0 +1,2 @@ +foo +.bar() diff --git a/test/__fixtures__/patterns-glob/fixtures-4/0/1/2/level-3.js b/test/__fixtures__/patterns-glob/fixtures-4/0/1/2/level-3.js new file mode 100644 index 0000000..11d7772 --- /dev/null +++ b/test/__fixtures__/patterns-glob/fixtures-4/0/1/2/level-3.js @@ -0,0 +1,2 @@ +foo +.bar() diff --git a/test/__fixtures__/patterns-glob/fixtures-4/0/1/level-2.js b/test/__fixtures__/patterns-glob/fixtures-4/0/1/level-2.js new file mode 100644 index 0000000..11d7772 --- /dev/null +++ b/test/__fixtures__/patterns-glob/fixtures-4/0/1/level-2.js @@ -0,0 +1,2 @@ +foo +.bar() diff --git a/test/__fixtures__/patterns-glob/fixtures-4/0/level-1.js b/test/__fixtures__/patterns-glob/fixtures-4/0/level-1.js new file mode 100644 index 0000000..11d7772 --- /dev/null +++ b/test/__fixtures__/patterns-glob/fixtures-4/0/level-1.js @@ -0,0 +1,2 @@ +foo +.bar() diff --git a/test/__fixtures__/patterns-glob/fixtures-4/level-0.js b/test/__fixtures__/patterns-glob/fixtures-4/level-0.js new file mode 100644 index 0000000..11d7772 --- /dev/null +++ b/test/__fixtures__/patterns-glob/fixtures-4/level-0.js @@ -0,0 +1,2 @@ +foo +.bar() diff --git a/test/__fixtures__/patterns-glob/fixtures-5/constructor/should-be-formatted.js b/test/__fixtures__/patterns-glob/fixtures-5/constructor/should-be-formatted.js new file mode 100644 index 0000000..9c26669 --- /dev/null +++ b/test/__fixtures__/patterns-glob/fixtures-5/constructor/should-be-formatted.js @@ -0,0 +1 @@ +console.log( "*"); diff --git a/test/__tests__/__snapshots__/patterns-glob.js.snap b/test/__tests__/__snapshots__/patterns-glob.js.snap new file mode 100644 index 0000000..c01feeb --- /dev/null +++ b/test/__tests__/__snapshots__/patterns-glob.js.snap @@ -0,0 +1,101 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`fixtures-1: Should match all files (stderr) 1`] = `""`; + +exports[`fixtures-1: Should match all files (stdout) 1`] = ` +"!file.js +a.js +b.js" +`; + +exports[`fixtures-1: Should match all files (write) 1`] = `[]`; + +exports[`fixtures-1: Should match files except \`a.js\` (stderr) 1`] = `""`; + +exports[`fixtures-1: Should match files except \`a.js\` (stdout) 1`] = ` +"!file.js +b.js" +`; + +exports[`fixtures-1: Should match files except \`a.js\` (write) 1`] = `[]`; + +exports[`fixtures-2: Should match \`a.js\` and \`!b.js\` (stderr) 1`] = `""`; + +exports[`fixtures-2: Should match \`a.js\` and \`!b.js\` (stdout) 1`] = ` +"!b.js +a.js" +`; + +exports[`fixtures-2: Should match \`a.js\` and \`!b.js\` (write) 1`] = `[]`; + +exports[`fixtures-2: Should match all js files and all supported files in the '!dir.js' directory (stderr) 1`] = `""`; + +exports[`fixtures-2: Should match all js files and all supported files in the '!dir.js' directory (stdout) 1`] = ` +"!b.js +a.js +!dir.js/1.css +!dir.js/2.css" +`; + +exports[`fixtures-2: Should match all js files and all supported files in the '!dir.js' directory (write) 1`] = `[]`; + +exports[`fixtures-2: Should only match \`!b.js\` (stderr) 1`] = `""`; + +exports[`fixtures-2: Should only match \`!b.js\` (stdout) 1`] = `"!b.js"`; + +exports[`fixtures-2: Should only match \`!b.js\` (write) 1`] = `[]`; + +exports[`fixtures-3: Should exclude \`.svn\` (existing) (stderr) 1`] = `""`; + +exports[`fixtures-3: Should exclude \`.svn\` (existing) (stdout) 1`] = `"outside.js"`; + +exports[`fixtures-3: Should exclude \`.svn\` (existing) (write) 1`] = `[]`; + +exports[`fixtures-3: Should exclude \`.svn\` (nonexisting) (stderr) 1`] = `""`; + +exports[`fixtures-3: Should exclude \`.svn\` (nonexisting) (stdout) 1`] = `"outside.js"`; + +exports[`fixtures-3: Should exclude \`.svn\` (nonexisting) (write) 1`] = `[]`; + +exports[`fixtures-3: Should match \`outside.js\`, \`dir/inside.js\` and \`dir/node_modules/in-node_modules.js\` (stderr) 1`] = `""`; + +exports[`fixtures-3: Should match \`outside.js\`, \`dir/inside.js\` and \`dir/node_modules/in-node_modules.js\` (stdout) 1`] = ` +"dir/inside.js +dir/node_modules/in-node_modules.js +outside.js" +`; + +exports[`fixtures-3: Should match \`outside.js\`, \`dir/inside.js\` and \`dir/node_modules/in-node_modules.js\` (write) 1`] = `[]`; + +exports[`fixtures-3: Should only match \`outside.js\` and \`dir/inside.js\` (stderr) 1`] = `""`; + +exports[`fixtures-3: Should only match \`outside.js\` and \`dir/inside.js\` (stdout) 1`] = ` +"dir/inside.js +outside.js" +`; + +exports[`fixtures-3: Should only match \`outside.js\` and \`dir/inside.js\` (write) 1`] = `[]`; + +exports[`fixtures-4: Should match \`level-1.js\` #2 (stderr) 1`] = `""`; + +exports[`fixtures-4: Should match \`level-1.js\` #2 (stdout) 1`] = `"0/level-1.js"`; + +exports[`fixtures-4: Should match \`level-1.js\` #2 (write) 1`] = `[]`; + +exports[`fixtures-4: Should match \`level-1.js\` #3 (stderr) 1`] = `""`; + +exports[`fixtures-4: Should match \`level-1.js\` #3 (stdout) 1`] = `"0/level-1.js"`; + +exports[`fixtures-4: Should match \`level-1.js\` #3 (write) 1`] = `[]`; + +exports[`fixtures-4: Should match \`level-1.js\` (stderr) 1`] = `""`; + +exports[`fixtures-4: Should match \`level-1.js\` (stdout) 1`] = `"0/level-1.js"`; + +exports[`fixtures-4: Should match \`level-1.js\` (write) 1`] = `[]`; + +exports[`should not ignore file paths contains object prototype keys (stderr) 1`] = `""`; + +exports[`should not ignore file paths contains object prototype keys (stdout) 1`] = `"constructor/should-be-formatted.js"`; + +exports[`should not ignore file paths contains object prototype keys (write) 1`] = `[]`; diff --git a/test/__tests__/patterns-glob.js b/test/__tests__/patterns-glob.js new file mode 100644 index 0000000..3224a31 --- /dev/null +++ b/test/__tests__/patterns-glob.js @@ -0,0 +1,115 @@ +/* +fixtures-1/ +├─ !file.js +├─ a.js +└─ b.js +*/ + +describe("fixtures-1: Should match all files", () => { + runCli("cli/patterns-glob/fixtures-1", ["*.js", "!file.js", "-l"]).test({ + status: 1, + }); +}); + +describe("fixtures-1: Should match files except `a.js`", () => { + runCli("cli/patterns-glob/fixtures-1", ["*.js", "!a.js", "-l"]).test({ + status: 1, + }); +}); + +/* + fixtures-2/ + ├─ a.js + ├─ !b.js + └─ !dir.js/ + ├─ 1.css + └─ 2.css + */ + +describe("fixtures-2: Should match all js files and all supported files in the '!dir.js' directory", () => { + runCli("cli/patterns-glob/fixtures-2", ["*.js", "!dir.js", "-l"]).test({ + status: 1, + }); +}); + +describe("fixtures-2: Should match `a.js` and `!b.js`", () => { + runCli("cli/patterns-glob/fixtures-2", ["*.js", "!b.js", "-l"]).test({ + status: 1, + }); +}); + +describe("fixtures-2: Should only match `!b.js`", () => { + runCli("cli/patterns-glob/fixtures-2", ["*.js", "!a.js", "-l"]).test({ + status: 1, + }); +}); + +/* + fixtures-3/ + ├─ outside.js + └─ dir + ├─ inside.js + ├─ node_modules/ + │ └─in-node_modules.js + └─ .svn/ + └─in-svn.js + */ + +describe("fixtures-3: Should match `outside.js`, `dir/inside.js` and `dir/node_modules/in-node_modules.js`", () => { + runCli("cli/patterns-glob/fixtures-3", ["**/*.js", "-l", "--with-node-modules"]).test({ + status: 1, + }); +}); + +describe("fixtures-3: Should only match `outside.js` and `dir/inside.js`", () => { + runCli("cli/patterns-glob/fixtures-3", ["**/*.js", "-l"]).test({ + status: 1, + }); +}); + +describe("fixtures-3: Should exclude `.svn`", () => { + describe("(existing)", () => { + runCli("cli/patterns-glob/fixtures-3", ["*.js", "dir/.svn/in-svn.js", "-l"]).test({ + status: 1, + }); + }); + + describe("(nonexisting)", () => { + runCli("cli/patterns-glob/fixtures-3", ["*.js", ".svn/in-svn.js", "-l"]).test({ + status: 1, + }); + }); +}); + +/* + fixtures-4/ + ├─ level-0.js + └─ 0 + ├─ level-1.js + └─ 1/ + ├─ level-2.js + └─ 2/ + └─ level-3.js + */ + +describe("fixtures-4: Should match `level-1.js`", () => { + runCli("cli/patterns-glob/fixtures-4", ["./0/./level-1.js", "-l"]).test({ + status: 1, + }); +}); + +describe("fixtures-4: Should match `level-1.js` #2", () => { + runCli("cli/patterns-glob/fixtures-4", ["./0/1/2/../../level-1.js", "-l"]).test({ + status: 1, + }); +}); + +describe("fixtures-4: Should match `level-1.js` #3", () => { + runCli("cli/patterns-glob/fixtures-4", ["./0/non-exists-dir/2/../../level-1.js", "-l"]).test({ + status: 1, + }); +}); + +describe("should not ignore file paths contains object prototype keys", () => { + runCli("cli/patterns-glob/fixtures-5", ["./constructor/should-be-formatted.js", "-l"]).test({ status: 1 }); +}); From 2fbe0735221e4624d5a15ed27c4c46d854b48355 Mon Sep 17 00:00:00 2001 From: pralkarz Date: Mon, 10 Feb 2025 12:13:39 +0100 Subject: [PATCH 3/9] Add the missing comma in VS Code settings --- .vscode/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 796b669..e4ca126 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,7 @@ { "[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" - } + }, "[typescript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" } From ef5fe7b3b9d1b8f8a4cc0661476081ce1ef299e1 Mon Sep 17 00:00:00 2001 From: pralkarz Date: Mon, 10 Feb 2025 12:19:18 +0100 Subject: [PATCH 4/9] Correct the filename in the fixture --- .../dir/node_modules/{in-node-modules.js => in-node_modules.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/__fixtures__/patterns-glob/fixtures-3/dir/node_modules/{in-node-modules.js => in-node_modules.js} (100%) diff --git a/test/__fixtures__/patterns-glob/fixtures-3/dir/node_modules/in-node-modules.js b/test/__fixtures__/patterns-glob/fixtures-3/dir/node_modules/in-node_modules.js similarity index 100% rename from test/__fixtures__/patterns-glob/fixtures-3/dir/node_modules/in-node-modules.js rename to test/__fixtures__/patterns-glob/fixtures-3/dir/node_modules/in-node_modules.js From da5bcb6066d9e83de0db7e18bb3399fddd61ce2d Mon Sep 17 00:00:00 2001 From: pralkarz Date: Mon, 10 Feb 2025 12:23:53 +0100 Subject: [PATCH 5/9] Skip failing tests --- test/__tests__/patterns-glob.js | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/test/__tests__/patterns-glob.js b/test/__tests__/patterns-glob.js index 3224a31..cb77f5a 100644 --- a/test/__tests__/patterns-glob.js +++ b/test/__tests__/patterns-glob.js @@ -1,3 +1,5 @@ +import { runCli } from "../utils"; + /* fixtures-1/ ├─ !file.js @@ -6,13 +8,13 @@ fixtures-1/ */ describe("fixtures-1: Should match all files", () => { - runCli("cli/patterns-glob/fixtures-1", ["*.js", "!file.js", "-l"]).test({ + runCli("patterns-glob/fixtures-1", ["*.js", "!file.js", "-l"]).test({ status: 1, }); }); describe("fixtures-1: Should match files except `a.js`", () => { - runCli("cli/patterns-glob/fixtures-1", ["*.js", "!a.js", "-l"]).test({ + runCli("patterns-glob/fixtures-1", ["*.js", "!a.js", "-l"]).test({ status: 1, }); }); @@ -26,20 +28,20 @@ describe("fixtures-1: Should match files except `a.js`", () => { └─ 2.css */ -describe("fixtures-2: Should match all js files and all supported files in the '!dir.js' directory", () => { - runCli("cli/patterns-glob/fixtures-2", ["*.js", "!dir.js", "-l"]).test({ +describe.skip("fixtures-2: Should match all js files and all supported files in the '!dir.js' directory", () => { + runCli("patterns-glob/fixtures-2", ["*.js", "!dir.js", "-l"]).test({ status: 1, }); }); describe("fixtures-2: Should match `a.js` and `!b.js`", () => { - runCli("cli/patterns-glob/fixtures-2", ["*.js", "!b.js", "-l"]).test({ + runCli("patterns-glob/fixtures-2", ["*.js", "!b.js", "-l"]).test({ status: 1, }); }); describe("fixtures-2: Should only match `!b.js`", () => { - runCli("cli/patterns-glob/fixtures-2", ["*.js", "!a.js", "-l"]).test({ + runCli("patterns-glob/fixtures-2", ["*.js", "!a.js", "-l"]).test({ status: 1, }); }); @@ -56,26 +58,26 @@ describe("fixtures-2: Should only match `!b.js`", () => { */ describe("fixtures-3: Should match `outside.js`, `dir/inside.js` and `dir/node_modules/in-node_modules.js`", () => { - runCli("cli/patterns-glob/fixtures-3", ["**/*.js", "-l", "--with-node-modules"]).test({ + runCli("patterns-glob/fixtures-3", ["**/*.js", "-l", "--with-node-modules"]).test({ status: 1, }); }); describe("fixtures-3: Should only match `outside.js` and `dir/inside.js`", () => { - runCli("cli/patterns-glob/fixtures-3", ["**/*.js", "-l"]).test({ + runCli("patterns-glob/fixtures-3", ["**/*.js", "-l"]).test({ status: 1, }); }); describe("fixtures-3: Should exclude `.svn`", () => { - describe("(existing)", () => { - runCli("cli/patterns-glob/fixtures-3", ["*.js", "dir/.svn/in-svn.js", "-l"]).test({ + describe.skip("(existing)", () => { + runCli("patterns-glob/fixtures-3", ["*.js", "dir/.svn/in-svn.js", "-l"]).test({ status: 1, }); }); describe("(nonexisting)", () => { - runCli("cli/patterns-glob/fixtures-3", ["*.js", ".svn/in-svn.js", "-l"]).test({ + runCli("patterns-glob/fixtures-3", ["*.js", ".svn/in-svn.js", "-l"]).test({ status: 1, }); }); @@ -93,23 +95,23 @@ describe("fixtures-3: Should exclude `.svn`", () => { */ describe("fixtures-4: Should match `level-1.js`", () => { - runCli("cli/patterns-glob/fixtures-4", ["./0/./level-1.js", "-l"]).test({ + runCli("patterns-glob/fixtures-4", ["./0/./level-1.js", "-l"]).test({ status: 1, }); }); describe("fixtures-4: Should match `level-1.js` #2", () => { - runCli("cli/patterns-glob/fixtures-4", ["./0/1/2/../../level-1.js", "-l"]).test({ + runCli("patterns-glob/fixtures-4", ["./0/1/2/../../level-1.js", "-l"]).test({ status: 1, }); }); describe("fixtures-4: Should match `level-1.js` #3", () => { - runCli("cli/patterns-glob/fixtures-4", ["./0/non-exists-dir/2/../../level-1.js", "-l"]).test({ + runCli("patterns-glob/fixtures-4", ["./0/non-exists-dir/2/../../level-1.js", "-l"]).test({ status: 1, }); }); describe("should not ignore file paths contains object prototype keys", () => { - runCli("cli/patterns-glob/fixtures-5", ["./constructor/should-be-formatted.js", "-l"]).test({ status: 1 }); + runCli("patterns-glob/fixtures-5", ["./constructor/should-be-formatted.js", "-l"]).test({ status: 1 }); }); From da606f8ccdd5d75792f53d892e0412e9ff1e8c87 Mon Sep 17 00:00:00 2001 From: pralkarz Date: Mon, 10 Feb 2025 13:40:47 +0100 Subject: [PATCH 6/9] Fix whitespace in multiline comments --- test/__tests__/patterns-glob.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/__tests__/patterns-glob.js b/test/__tests__/patterns-glob.js index cb77f5a..67c1772 100644 --- a/test/__tests__/patterns-glob.js +++ b/test/__tests__/patterns-glob.js @@ -26,7 +26,7 @@ describe("fixtures-1: Should match files except `a.js`", () => { └─ !dir.js/ ├─ 1.css └─ 2.css - */ +*/ describe.skip("fixtures-2: Should match all js files and all supported files in the '!dir.js' directory", () => { runCli("patterns-glob/fixtures-2", ["*.js", "!dir.js", "-l"]).test({ @@ -55,7 +55,7 @@ describe("fixtures-2: Should only match `!b.js`", () => { │ └─in-node_modules.js └─ .svn/ └─in-svn.js - */ +*/ describe("fixtures-3: Should match `outside.js`, `dir/inside.js` and `dir/node_modules/in-node_modules.js`", () => { runCli("patterns-glob/fixtures-3", ["**/*.js", "-l", "--with-node-modules"]).test({ @@ -92,7 +92,7 @@ describe("fixtures-3: Should exclude `.svn`", () => { ├─ level-2.js └─ 2/ └─ level-3.js - */ +*/ describe("fixtures-4: Should match `level-1.js`", () => { runCli("patterns-glob/fixtures-4", ["./0/./level-1.js", "-l"]).test({ From 1e4a20339d72883fafe7889f0efa1dc32bf470fa Mon Sep 17 00:00:00 2001 From: pralkarz Date: Mon, 10 Feb 2025 13:40:57 +0100 Subject: [PATCH 7/9] Enable the `!dir.js` test Tested with a locally built `tiny-readdir-glob` with a fix for this edge case. Snapshot needed to be adjusted as it seems we're returning the results alphabetically in v4. --- test/__tests__/__snapshots__/patterns-glob.js.snap | 4 ++-- test/__tests__/patterns-glob.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/__tests__/__snapshots__/patterns-glob.js.snap b/test/__tests__/__snapshots__/patterns-glob.js.snap index c01feeb..b469162 100644 --- a/test/__tests__/__snapshots__/patterns-glob.js.snap +++ b/test/__tests__/__snapshots__/patterns-glob.js.snap @@ -32,9 +32,9 @@ exports[`fixtures-2: Should match all js files and all supported files in the '! exports[`fixtures-2: Should match all js files and all supported files in the '!dir.js' directory (stdout) 1`] = ` "!b.js -a.js !dir.js/1.css -!dir.js/2.css" +!dir.js/2.css +a.js" `; exports[`fixtures-2: Should match all js files and all supported files in the '!dir.js' directory (write) 1`] = `[]`; diff --git a/test/__tests__/patterns-glob.js b/test/__tests__/patterns-glob.js index 67c1772..c25e332 100644 --- a/test/__tests__/patterns-glob.js +++ b/test/__tests__/patterns-glob.js @@ -28,7 +28,7 @@ describe("fixtures-1: Should match files except `a.js`", () => { └─ 2.css */ -describe.skip("fixtures-2: Should match all js files and all supported files in the '!dir.js' directory", () => { +describe("fixtures-2: Should match all js files and all supported files in the '!dir.js' directory", () => { runCli("patterns-glob/fixtures-2", ["*.js", "!dir.js", "-l"]).test({ status: 1, }); From 2d9b3898f4d00edffb68ef46ea42dedb21b9c85f Mon Sep 17 00:00:00 2001 From: pralkarz Date: Mon, 10 Feb 2025 13:52:34 +0100 Subject: [PATCH 8/9] Align the remaining test with the behavior in v4 When explicitly targeting a file in a forbidden directory (e.g. `.svn`), we don't want to exclude it from the results. --- .../__snapshots__/patterns-glob.js.snap | 27 ++++++++++--------- test/__tests__/patterns-glob.js | 4 +-- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/test/__tests__/__snapshots__/patterns-glob.js.snap b/test/__tests__/__snapshots__/patterns-glob.js.snap index b469162..510a4c6 100644 --- a/test/__tests__/__snapshots__/patterns-glob.js.snap +++ b/test/__tests__/__snapshots__/patterns-glob.js.snap @@ -45,18 +45,6 @@ exports[`fixtures-2: Should only match \`!b.js\` (stdout) 1`] = `"!b.js"`; exports[`fixtures-2: Should only match \`!b.js\` (write) 1`] = `[]`; -exports[`fixtures-3: Should exclude \`.svn\` (existing) (stderr) 1`] = `""`; - -exports[`fixtures-3: Should exclude \`.svn\` (existing) (stdout) 1`] = `"outside.js"`; - -exports[`fixtures-3: Should exclude \`.svn\` (existing) (write) 1`] = `[]`; - -exports[`fixtures-3: Should exclude \`.svn\` (nonexisting) (stderr) 1`] = `""`; - -exports[`fixtures-3: Should exclude \`.svn\` (nonexisting) (stdout) 1`] = `"outside.js"`; - -exports[`fixtures-3: Should exclude \`.svn\` (nonexisting) (write) 1`] = `[]`; - exports[`fixtures-3: Should match \`outside.js\`, \`dir/inside.js\` and \`dir/node_modules/in-node_modules.js\` (stderr) 1`] = `""`; exports[`fixtures-3: Should match \`outside.js\`, \`dir/inside.js\` and \`dir/node_modules/in-node_modules.js\` (stdout) 1`] = ` @@ -67,6 +55,21 @@ outside.js" exports[`fixtures-3: Should match \`outside.js\`, \`dir/inside.js\` and \`dir/node_modules/in-node_modules.js\` (write) 1`] = `[]`; +exports[`fixtures-3: Should not exclude \`.svn\` when specified explicitly (existing) (stderr) 1`] = `""`; + +exports[`fixtures-3: Should not exclude \`.svn\` when specified explicitly (existing) (stdout) 1`] = ` +"dir/.svn/in-svn.js +outside.js" +`; + +exports[`fixtures-3: Should not exclude \`.svn\` when specified explicitly (existing) (write) 1`] = `[]`; + +exports[`fixtures-3: Should not exclude \`.svn\` when specified explicitly (nonexisting) (stderr) 1`] = `""`; + +exports[`fixtures-3: Should not exclude \`.svn\` when specified explicitly (nonexisting) (stdout) 1`] = `"outside.js"`; + +exports[`fixtures-3: Should not exclude \`.svn\` when specified explicitly (nonexisting) (write) 1`] = `[]`; + exports[`fixtures-3: Should only match \`outside.js\` and \`dir/inside.js\` (stderr) 1`] = `""`; exports[`fixtures-3: Should only match \`outside.js\` and \`dir/inside.js\` (stdout) 1`] = ` diff --git a/test/__tests__/patterns-glob.js b/test/__tests__/patterns-glob.js index c25e332..30cdbb8 100644 --- a/test/__tests__/patterns-glob.js +++ b/test/__tests__/patterns-glob.js @@ -69,8 +69,8 @@ describe("fixtures-3: Should only match `outside.js` and `dir/inside.js`", () => }); }); -describe("fixtures-3: Should exclude `.svn`", () => { - describe.skip("(existing)", () => { +describe("fixtures-3: Should not exclude `.svn` when specified explicitly", () => { + describe("(existing)", () => { runCli("patterns-glob/fixtures-3", ["*.js", "dir/.svn/in-svn.js", "-l"]).test({ status: 1, }); From 95e5ad6b3b652651d4afeffe8b8bde9ad84015d0 Mon Sep 17 00:00:00 2001 From: pralkarz Date: Sat, 22 Feb 2025 19:09:09 +0100 Subject: [PATCH 9/9] Remove the test for now-unsupported behavior See https://github.com/fabiospampinato/tiny-readdir-glob/pull/4 for details. --- test/__tests__/__snapshots__/patterns-glob.js.snap | 11 ----------- test/__tests__/patterns-glob.js | 6 ------ 2 files changed, 17 deletions(-) diff --git a/test/__tests__/__snapshots__/patterns-glob.js.snap b/test/__tests__/__snapshots__/patterns-glob.js.snap index 510a4c6..1a6c7d9 100644 --- a/test/__tests__/__snapshots__/patterns-glob.js.snap +++ b/test/__tests__/__snapshots__/patterns-glob.js.snap @@ -28,17 +28,6 @@ a.js" exports[`fixtures-2: Should match \`a.js\` and \`!b.js\` (write) 1`] = `[]`; -exports[`fixtures-2: Should match all js files and all supported files in the '!dir.js' directory (stderr) 1`] = `""`; - -exports[`fixtures-2: Should match all js files and all supported files in the '!dir.js' directory (stdout) 1`] = ` -"!b.js -!dir.js/1.css -!dir.js/2.css -a.js" -`; - -exports[`fixtures-2: Should match all js files and all supported files in the '!dir.js' directory (write) 1`] = `[]`; - exports[`fixtures-2: Should only match \`!b.js\` (stderr) 1`] = `""`; exports[`fixtures-2: Should only match \`!b.js\` (stdout) 1`] = `"!b.js"`; diff --git a/test/__tests__/patterns-glob.js b/test/__tests__/patterns-glob.js index 30cdbb8..bd1ae98 100644 --- a/test/__tests__/patterns-glob.js +++ b/test/__tests__/patterns-glob.js @@ -28,12 +28,6 @@ describe("fixtures-1: Should match files except `a.js`", () => { └─ 2.css */ -describe("fixtures-2: Should match all js files and all supported files in the '!dir.js' directory", () => { - runCli("patterns-glob/fixtures-2", ["*.js", "!dir.js", "-l"]).test({ - status: 1, - }); -}); - describe("fixtures-2: Should match `a.js` and `!b.js`", () => { runCli("patterns-glob/fixtures-2", ["*.js", "!b.js", "-l"]).test({ status: 1,