From 159566798d37db42b8138ee4ecabb2ba32defc31 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Sat, 2 Nov 2019 01:02:34 +0800 Subject: [PATCH] Move `multiple-patterns` tests to `patterns` (#6777) --- ...iple-patterns.js.snap => patterns.js.snap} | 0 .../{multiple-patterns.js => patterns.js} | 26 +++++++------------ .../directory/file.js | 0 .../nested-directory/nested-directory-file.js | 0 .../node_modules/node-module.js | 0 .../other-directory/file.js | 0 .../nested-directory/nested-directory-file.js | 0 .../other-regular-modules.js | 0 .../regular-module.js | 0 9 files changed, 10 insertions(+), 16 deletions(-) rename tests_integration/__tests__/__snapshots__/{multiple-patterns.js.snap => patterns.js.snap} (100%) rename tests_integration/__tests__/{multiple-patterns.js => patterns.js} (73%) rename tests_integration/cli/{multiple-patterns => patterns}/directory/file.js (100%) rename tests_integration/cli/{multiple-patterns => patterns}/directory/nested-directory/nested-directory-file.js (100%) rename tests_integration/cli/{multiple-patterns => patterns}/node_modules/node-module.js (100%) rename tests_integration/cli/{multiple-patterns => patterns}/other-directory/file.js (100%) rename tests_integration/cli/{multiple-patterns => patterns}/other-directory/nested-directory/nested-directory-file.js (100%) rename tests_integration/cli/{multiple-patterns => patterns}/other-regular-modules.js (100%) rename tests_integration/cli/{multiple-patterns => patterns}/regular-module.js (100%) diff --git a/tests_integration/__tests__/__snapshots__/multiple-patterns.js.snap b/tests_integration/__tests__/__snapshots__/patterns.js.snap similarity index 100% rename from tests_integration/__tests__/__snapshots__/multiple-patterns.js.snap rename to tests_integration/__tests__/__snapshots__/patterns.js.snap diff --git a/tests_integration/__tests__/multiple-patterns.js b/tests_integration/__tests__/patterns.js similarity index 73% rename from tests_integration/__tests__/multiple-patterns.js rename to tests_integration/__tests__/patterns.js index 008c3952..c51132b6 100644 --- a/tests_integration/__tests__/multiple-patterns.js +++ b/tests_integration/__tests__/patterns.js @@ -5,7 +5,7 @@ const runPrettier = require("../runPrettier"); expect.addSnapshotSerializer(require("../path-serializer")); describe("multiple patterns", () => { - runPrettier("cli/multiple-patterns", [ + runPrettier("cli/patterns", [ "directory/**/*.js", "other-directory/**/*.js", "-l" @@ -15,7 +15,7 @@ describe("multiple patterns", () => { }); describe("multiple patterns with non exists pattern", () => { - runPrettier("cli/multiple-patterns", [ + runPrettier("cli/patterns", [ "directory/**/*.js", "non-existent.js", "-l" @@ -25,7 +25,7 @@ describe("multiple patterns with non exists pattern", () => { }); describe("multiple patterns with ignore nested directories pattern", () => { - runPrettier("cli/multiple-patterns", [ + runPrettier("cli/patterns", [ "**/*.js", "!**/nested-directory/**", "-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", () => { - runPrettier("cli/multiple-patterns", ["**/*.js", "!directory/**", "-l"]).test( - { - status: 1 - } - ); + runPrettier("cli/patterns", ["**/*.js", "!directory/**", "-l"]).test({ + status: 1 + }); }); describe("multiple patterns by with ignore pattern, ignores node_modules by with ./**/*.js", () => { - runPrettier("cli/multiple-patterns", [ - "./**/*.js", - "!./directory/**", - "-l" - ]).test({ + runPrettier("cli/patterns", ["./**/*.js", "!./directory/**", "-l"]).test({ status: 1 }); }); 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", "!directory/**", "-l", @@ -65,13 +59,13 @@ describe("multiple patterns by with ignore pattern, doesn't ignore node_modules describe("no errors on empty patterns", () => { // --parser is mandatory if no filepath is passed - runPrettier("cli/multiple-patterns", ["--parser", "babel"]).test({ + runPrettier("cli/patterns", ["--parser", "babel"]).test({ status: 0 }); }); 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", "other-non-existent.js", "-l" diff --git a/tests_integration/cli/multiple-patterns/directory/file.js b/tests_integration/cli/patterns/directory/file.js similarity index 100% rename from tests_integration/cli/multiple-patterns/directory/file.js rename to tests_integration/cli/patterns/directory/file.js diff --git a/tests_integration/cli/multiple-patterns/directory/nested-directory/nested-directory-file.js b/tests_integration/cli/patterns/directory/nested-directory/nested-directory-file.js similarity index 100% rename from tests_integration/cli/multiple-patterns/directory/nested-directory/nested-directory-file.js rename to tests_integration/cli/patterns/directory/nested-directory/nested-directory-file.js diff --git a/tests_integration/cli/multiple-patterns/node_modules/node-module.js b/tests_integration/cli/patterns/node_modules/node-module.js similarity index 100% rename from tests_integration/cli/multiple-patterns/node_modules/node-module.js rename to tests_integration/cli/patterns/node_modules/node-module.js diff --git a/tests_integration/cli/multiple-patterns/other-directory/file.js b/tests_integration/cli/patterns/other-directory/file.js similarity index 100% rename from tests_integration/cli/multiple-patterns/other-directory/file.js rename to tests_integration/cli/patterns/other-directory/file.js diff --git a/tests_integration/cli/multiple-patterns/other-directory/nested-directory/nested-directory-file.js b/tests_integration/cli/patterns/other-directory/nested-directory/nested-directory-file.js similarity index 100% rename from tests_integration/cli/multiple-patterns/other-directory/nested-directory/nested-directory-file.js rename to tests_integration/cli/patterns/other-directory/nested-directory/nested-directory-file.js diff --git a/tests_integration/cli/multiple-patterns/other-regular-modules.js b/tests_integration/cli/patterns/other-regular-modules.js similarity index 100% rename from tests_integration/cli/multiple-patterns/other-regular-modules.js rename to tests_integration/cli/patterns/other-regular-modules.js diff --git a/tests_integration/cli/multiple-patterns/regular-module.js b/tests_integration/cli/patterns/regular-module.js similarity index 100% rename from tests_integration/cli/multiple-patterns/regular-module.js rename to tests_integration/cli/patterns/regular-module.js