-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ad8648
commit c373e50
Showing
19 changed files
with
281 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
foo. | ||
bar() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
foo. | ||
bar() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
foo. | ||
bar() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
foo. | ||
bar() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.foo | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.foo | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
foo. | ||
bar() |
2 changes: 2 additions & 0 deletions
2
test/__fixtures__/patterns-glob/fixtures-3/dir/.svn/in-svn.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
foo | ||
.bar() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
foo | ||
.bar() |
2 changes: 2 additions & 0 deletions
2
test/__fixtures__/patterns-glob/fixtures-3/dir/node_modules/in-node_modules.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
foo | ||
.bar() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
foo | ||
.bar() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
foo | ||
.bar() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
foo | ||
.bar() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
foo | ||
.bar() |
1 change: 1 addition & 0 deletions
1
test/__fixtures__/patterns-glob/fixtures-5/constructor/should-be-formatted.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log( "*"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
// 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 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 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 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`] = ` | ||
"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`] = `[]`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
import { runCli } from "../utils"; | ||
|
||
/* | ||
fixtures-1/ | ||
├─ !file.js | ||
├─ a.js | ||
└─ b.js | ||
*/ | ||
|
||
describe("fixtures-1: Should match all files", () => { | ||
runCli("patterns-glob/fixtures-1", [ | ||
"*.js", | ||
"!file.js", | ||
"-l", | ||
]).test({ | ||
status: 1, | ||
}); | ||
}); | ||
|
||
describe("fixtures-1: Should match files except `a.js`", () => { | ||
runCli("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 `a.js` and `!b.js`", () => { | ||
runCli("patterns-glob/fixtures-2", [ | ||
"*.js", | ||
"!b.js", | ||
"-l", | ||
]).test({ | ||
status: 1, | ||
}); | ||
}); | ||
|
||
describe("fixtures-2: Should only match `!b.js`", () => { | ||
runCli("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("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("patterns-glob/fixtures-3", [ | ||
"**/*.js", | ||
"-l", | ||
]).test({ | ||
status: 1, | ||
}); | ||
}); | ||
|
||
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, | ||
}); | ||
}); | ||
|
||
describe("(nonexisting)", () => { | ||
runCli("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("patterns-glob/fixtures-4", [ | ||
"./0/./level-1.js", | ||
"-l", | ||
]).test({ | ||
status: 1, | ||
}); | ||
}); | ||
|
||
describe("fixtures-4: Should match `level-1.js` #2", () => { | ||
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("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("patterns-glob/fixtures-5", [ | ||
"./constructor/should-be-formatted.js", | ||
"-l" | ||
]).test({ | ||
status: 1, | ||
}); | ||
}); |