Move `multiple-patterns` tests to `patterns` (#6777)
parent
ea6ae31ba0
commit
159566798d
|
@ -5,7 +5,7 @@ const runPrettier = require("../runPrettier");
|
||||||
expect.addSnapshotSerializer(require("../path-serializer"));
|
expect.addSnapshotSerializer(require("../path-serializer"));
|
||||||
|
|
||||||
describe("multiple patterns", () => {
|
describe("multiple patterns", () => {
|
||||||
runPrettier("cli/multiple-patterns", [
|
runPrettier("cli/patterns", [
|
||||||
"directory/**/*.js",
|
"directory/**/*.js",
|
||||||
"other-directory/**/*.js",
|
"other-directory/**/*.js",
|
||||||
"-l"
|
"-l"
|
||||||
|
@ -15,7 +15,7 @@ describe("multiple patterns", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("multiple patterns with non exists pattern", () => {
|
describe("multiple patterns with non exists pattern", () => {
|
||||||
runPrettier("cli/multiple-patterns", [
|
runPrettier("cli/patterns", [
|
||||||
"directory/**/*.js",
|
"directory/**/*.js",
|
||||||
"non-existent.js",
|
"non-existent.js",
|
||||||
"-l"
|
"-l"
|
||||||
|
@ -25,7 +25,7 @@ describe("multiple patterns with non exists pattern", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("multiple patterns with ignore nested directories pattern", () => {
|
describe("multiple patterns with ignore nested directories pattern", () => {
|
||||||
runPrettier("cli/multiple-patterns", [
|
runPrettier("cli/patterns", [
|
||||||
"**/*.js",
|
"**/*.js",
|
||||||
"!**/nested-directory/**",
|
"!**/nested-directory/**",
|
||||||
"-l"
|
"-l"
|
||||||
|
@ -35,25 +35,19 @@ describe("multiple patterns with ignore nested directories pattern", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("multiple patterns by with ignore pattern, ignores node_modules by default", () => {
|
describe("multiple patterns by with ignore pattern, ignores node_modules by default", () => {
|
||||||
runPrettier("cli/multiple-patterns", ["**/*.js", "!directory/**", "-l"]).test(
|
runPrettier("cli/patterns", ["**/*.js", "!directory/**", "-l"]).test({
|
||||||
{
|
|
||||||
status: 1
|
status: 1
|
||||||
}
|
});
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("multiple patterns by with ignore pattern, ignores node_modules by with ./**/*.js", () => {
|
describe("multiple patterns by with ignore pattern, ignores node_modules by with ./**/*.js", () => {
|
||||||
runPrettier("cli/multiple-patterns", [
|
runPrettier("cli/patterns", ["./**/*.js", "!./directory/**", "-l"]).test({
|
||||||
"./**/*.js",
|
|
||||||
"!./directory/**",
|
|
||||||
"-l"
|
|
||||||
]).test({
|
|
||||||
status: 1
|
status: 1
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("multiple patterns by with ignore pattern, doesn't ignore node_modules with --with-node-modules flag", () => {
|
describe("multiple patterns by with ignore pattern, doesn't ignore node_modules with --with-node-modules flag", () => {
|
||||||
runPrettier("cli/multiple-patterns", [
|
runPrettier("cli/patterns", [
|
||||||
"**/*.js",
|
"**/*.js",
|
||||||
"!directory/**",
|
"!directory/**",
|
||||||
"-l",
|
"-l",
|
||||||
|
@ -65,13 +59,13 @@ describe("multiple patterns by with ignore pattern, doesn't ignore node_modules
|
||||||
|
|
||||||
describe("no errors on empty patterns", () => {
|
describe("no errors on empty patterns", () => {
|
||||||
// --parser is mandatory if no filepath is passed
|
// --parser is mandatory if no filepath is passed
|
||||||
runPrettier("cli/multiple-patterns", ["--parser", "babel"]).test({
|
runPrettier("cli/patterns", ["--parser", "babel"]).test({
|
||||||
status: 0
|
status: 0
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("multiple patterns, throw error and exit with non zero code on non existing files", () => {
|
describe("multiple patterns, throw error and exit with non zero code on non existing files", () => {
|
||||||
runPrettier("cli/multiple-patterns", [
|
runPrettier("cli/patterns", [
|
||||||
"non-existent.js",
|
"non-existent.js",
|
||||||
"other-non-existent.js",
|
"other-non-existent.js",
|
||||||
"-l"
|
"-l"
|
Loading…
Reference in New Issue