MCPcopy
hub / github.com/prettier/prettier / testPatterns

Function testPatterns

tests/integration/__tests__/patterns-dirs.js:369–389  ·  view source on GitHub ↗
(
  namePrefix,
  cliArgs,
  expected = {},
  cwd = "cli/patterns-dirs",
)

Source from the content-addressed store, hash-verified

367});
368
369function testPatterns(
370 namePrefix,
371 cliArgs,
372 expected = {},
373 cwd = "cli/patterns-dirs",
374) {
375 const testName =
376 (namePrefix ? namePrefix + ": " : "") +
377 "prettier " +
378 cliArgs
379 .map((arg) => (/^[\w./=-]+$/.test(arg) ? arg : `'${arg}'`))
380 .join(" ");
381
382 describe(testName, () => {
383 runCliWithoutGitignore(cwd, [...cliArgs, "-l"]).test({
384 write: [],
385 ...("status" in expected ? {} : { stderr: "", status: 1 }),
386 ...expected,
387 });
388 });
389}

Callers 1

patterns-dirs.jsFile · 0.85

Calls 3

runCliWithoutGitignoreFunction · 0.70
mapMethod · 0.45
testMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…