2017-05-24 00:19:04 +03:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
const runPrettier = require("../runPrettier");
|
|
|
|
|
2017-11-07 06:39:07 +03:00
|
|
|
expect.addSnapshotSerializer(require("../path-serializer"));
|
|
|
|
|
2017-10-02 19:08:34 +03:00
|
|
|
describe("ignores node_modules by default", () => {
|
|
|
|
runPrettier("cli/with-node-modules", ["**/*.js", "-l"]).test({
|
|
|
|
status: 1
|
|
|
|
});
|
2017-06-18 07:35:42 +03:00
|
|
|
});
|
|
|
|
|
2017-10-02 19:08:34 +03:00
|
|
|
describe("ignores node_modules by with ./**/*.js", () => {
|
|
|
|
runPrettier("cli/with-node-modules", ["./**/*.js", "-l"]).test({
|
|
|
|
status: 1
|
|
|
|
});
|
2017-05-24 00:19:04 +03:00
|
|
|
});
|
|
|
|
|
2017-10-02 19:08:34 +03:00
|
|
|
describe("doesn't ignore node_modules with --with-node-modules flag", () => {
|
|
|
|
runPrettier("cli/with-node-modules", [
|
2017-05-24 00:19:04 +03:00
|
|
|
"**/*.js",
|
|
|
|
"-l",
|
|
|
|
"--with-node-modules"
|
2017-10-02 19:08:34 +03:00
|
|
|
]).test({
|
|
|
|
status: 1
|
|
|
|
});
|
2017-05-24 00:19:04 +03:00
|
|
|
});
|
|
|
|
|
2017-10-02 19:08:34 +03:00
|
|
|
describe("ignores node_modules by default for file list", () => {
|
|
|
|
runPrettier("cli/with-node-modules", [
|
2017-05-24 00:19:04 +03:00
|
|
|
"node_modules/node-module.js",
|
|
|
|
"not_node_modules/file.js",
|
|
|
|
"regular-module.js",
|
|
|
|
"-l"
|
2017-10-02 19:08:34 +03:00
|
|
|
]).test({
|
|
|
|
status: 1
|
|
|
|
});
|
2017-05-24 00:19:04 +03:00
|
|
|
});
|
|
|
|
|
2017-10-02 19:08:34 +03:00
|
|
|
describe("doesn't ignore node_modules with --with-node-modules flag for file list", () => {
|
|
|
|
runPrettier("cli/with-node-modules", [
|
2017-05-24 00:19:04 +03:00
|
|
|
"node_modules/node-module.js",
|
|
|
|
"not_node_modules/file.js",
|
|
|
|
"regular-module.js",
|
|
|
|
"-l",
|
|
|
|
"--with-node-modules"
|
2017-10-02 19:08:34 +03:00
|
|
|
]).test({
|
|
|
|
status: 1
|
|
|
|
});
|
2017-05-24 00:19:04 +03:00
|
|
|
});
|