* Sync README -> docs/options.md * Sync README -> docs/*.md * Misc fixups * Remove markdown-toc * Remove insert-pragma from ToC * Never again! * Move all docs to ./docs * Remove yarn toc * Fix inter-doc links * Fix links in footer * Clean up README.md * Add basic description to README.md * Use flat badges * Move editor guides to website * Improve prettier-ignore docs * Fixup bad find/replace * Add JSON to README * Fix custom parser API link * Fixup GitHub centering, add downloads badge * Add 1.8 docs * docs(website): mention markdown on homepage (#1) * Add intro * Add watching-files.md * Fix markdown syntax highlighting * Switch back to .md links
83 lines
1.7 KiB
JavaScript
83 lines
1.7 KiB
JavaScript
"use strict";
|
|
|
|
const runPrettier = require("../runPrettier");
|
|
|
|
expect.addSnapshotSerializer(require("../path-serializer"));
|
|
|
|
describe("multiple patterns", () => {
|
|
runPrettier("cli/multiple-patterns", [
|
|
"directory/**/*.js",
|
|
"other-directory/**/*.js",
|
|
"-l"
|
|
]).test({
|
|
status: 1
|
|
});
|
|
});
|
|
|
|
describe("multiple patterns with non exists pattern", () => {
|
|
runPrettier("cli/multiple-patterns", [
|
|
"directory/**/*.js",
|
|
"non-existent.js",
|
|
"-l"
|
|
]).test({
|
|
status: 1
|
|
});
|
|
});
|
|
|
|
describe("multiple patterns with ignore nested directories pattern", () => {
|
|
runPrettier("cli/multiple-patterns", [
|
|
"**/*.js",
|
|
"!**/nested-directory/**",
|
|
"-l"
|
|
]).test({
|
|
status: 1
|
|
});
|
|
});
|
|
|
|
describe("multiple patterns by with ignore pattern, ignores node_modules by default", () => {
|
|
runPrettier("cli/multiple-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({
|
|
status: 1
|
|
});
|
|
});
|
|
|
|
describe("multiple patterns by with ignore pattern, doesn't ignore node_modules with --with-node-modules flag", () => {
|
|
runPrettier("cli/multiple-patterns", [
|
|
"**/*.js",
|
|
"!directory/**",
|
|
"-l",
|
|
"--with-node-modules"
|
|
]).test({
|
|
status: 1
|
|
});
|
|
});
|
|
|
|
describe("no errors on empty patterns", () => {
|
|
runPrettier("cli/multiple-patterns").test({
|
|
status: 0
|
|
});
|
|
});
|
|
|
|
describe("multiple patterns, throw error and exit with non zero code on non existing files", () => {
|
|
runPrettier("cli/multiple-patterns", [
|
|
"non-existent.js",
|
|
"other-non-existent.js",
|
|
"-l"
|
|
]).test({
|
|
status: 2
|
|
});
|
|
});
|