-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ported test suite: error-no-unmatched-pattern
- Errors are thrown if no results are found for every glob, not any glob.
- Loading branch information
1 parent
13825b8
commit 51c4400
Showing
5 changed files
with
79 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
const hello = "there"; |
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,3 @@ | ||
{ | ||
"hello": "there" | ||
} |
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 @@ | ||
hello: there |
37 changes: 37 additions & 0 deletions
37
test/__tests__/__snapshots__/error-on-unmatched-pattern.js.snap
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,37 @@ | ||
// 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 (stdout) 1`] = `""`; | ||
|
||
exports[`error on unmatched pattern (write) 1`] = `[]`; | ||
|
||
exports[`error on unmatched pattern when 2nd glob has no match, by default (stderr) 1`] = `""`; | ||
|
||
exports[`error on unmatched pattern when 2nd glob has no match, by default (stdout) 1`] = ` | ||
"const hello = "there"; | ||
{ | ||
"hello": "there" | ||
} | ||
hello: there" | ||
`; | ||
|
||
exports[`error on unmatched pattern when 2nd glob has no match, by default (write) 1`] = `[]`; | ||
|
||
exports[`no error on unmatched pattern (stderr) 1`] = `""`; | ||
|
||
exports[`no error on unmatched pattern (stdout) 1`] = `"const hello = "there";"`; | ||
|
||
exports[`no error on unmatched pattern (write) 1`] = `[]`; | ||
|
||
exports[`no error on unmatched pattern when 2nd glob has no match, with flag (stderr) 1`] = `""`; | ||
|
||
exports[`no error on unmatched pattern when 2nd glob has no match, with flag (stdout) 1`] = ` | ||
"const hello = "there"; | ||
{ | ||
"hello": "there" | ||
} | ||
hello: there" | ||
`; | ||
|
||
exports[`no error on unmatched pattern when 2nd glob has no match, with flag (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,37 @@ | ||
import { runCli } from "../utils"; | ||
|
||
describe("no error on unmatched pattern", () => { | ||
runCli("error-on-unmatched-pattern", [ | ||
"--no-error-on-unmatched-pattern", | ||
"**/*.js", | ||
]).test({ | ||
status: 0, | ||
}); | ||
}); | ||
|
||
describe("error on unmatched pattern", () => { | ||
runCli("error-on-unmatched-pattern", [ | ||
"**/*.toml", | ||
]).test({ | ||
status: 1, | ||
}); | ||
}); | ||
|
||
describe("no error on unmatched pattern when 2nd glob has no match, with flag", () => { | ||
runCli("error-on-unmatched-pattern", [ | ||
"--no-error-on-unmatched-pattern", | ||
"**/*.{json,js,yml}", | ||
"**/*.toml", | ||
]).test({ | ||
status: 0, | ||
}); | ||
}); | ||
|
||
describe("error on unmatched pattern when 2nd glob has no match, by default", () => { | ||
runCli("error-on-unmatched-pattern", [ | ||
"**/*.{json,js,yml}", | ||
"**/*.toml", | ||
]).test({ | ||
status: 0, | ||
}); | ||
}); |