# Testing signals — prettier/prettier

> Canonical page: https://codevetter.com/unpack/prettier/testing-signals

# Testing signals — prettier/prettier

Scanned commit 1a36a7defdcccfc4967e99bbf9517a02ab2345b2 (2026-09-22). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

Jest 30 with jest-light-runner drives four suites: snapshot format tests, CLI/API integration tests, unit tests, and dts tests. Format tests are directory fixtures plus runFormatTest, which implicitly adds extra JS parsers and, under FULL_TEST=1, AST-compare, second-format, EOL, and BOM checks. Production tests install dist/prettier and also run standalone and browser (Puppeteer) matrices. Unit tests are skipped in production; integration tests are skipped in standalone/browser.
- jest.config.js testMatch: tests/format/**/format.test.js, tests/integration/__tests__/**/*.js, tests/unit/**/*.js, tests/dts/unit/**/*.js. Runner is jest-light-runner (child-process unless ENABLE_CODE_COVERAGE). Snapshot serializers: jest-snapshot-serializer-raw and -ansi. — [jest.config.js#L83-131](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/jest.config.js#L83-L131) [package.json#L169-173](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/package.json#L169-L173)
- runFormatTest(import.meta, parsers, options) is the format-test DSL. getParsers implicitly adds acorn/espree/meriyah/oxc/yuku when babel is listed under tests/format/js|jsx; babel-ts/oxc-ts/yuku-ts when typescript is listed; hermes when flow is listed; __babel_estree when babel is listed. — [tests/config/format-test/run-format-test.js#L38-82](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/tests/config/format-test/run-format-test.js#L38-L82) [tests/config/format-test/get-parsers.js#L4-36](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/tests/config/format-test/get-parsers.js#L4-L36) [CONTRIBUTING.md#L11-76](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/CONTRIBUTING.md#L11-L76)
- test-format.js snapshots eolVisualizedOutput via createSnapshot; expectFail directories use toThrowErrorMatchingSnapshot. Additional FULL_TEST checks are described in CONTRIBUTING.md (compare AST, second format, CRLF/CR, BOM) and implemented under tests/config/format-test/. — [tests/config/format-test/test-format.js#L14-48](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/tests/config/format-test/test-format.js#L14-L48) [CONTRIBUTING.md#L144-153](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/CONTRIBUTING.md#L144-L153) [tests/config/format-test/test-ast-compare.js](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/tests/config/format-test/test-ast-compare.js) [tests/config/format-test/test-second-format.js](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/tests/config/format-test/test-second-format.js)
- tests/format is partitioned by language (js, jsx, typescript, flow, css, scss, less, html, vue, angular, markdown, mdx, yaml, graphql, handlebars, json, mjml, lwc, misc) with per-directory __snapshots__/format.test.js.snap. Flow’s tests/format/flow/flow-repo/ is synced via scripts/sync-flow-tests.cjs, not edited by hand. — [tests/format](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/tests/format) [CONTRIBUTING.md#L78](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/CONTRIBUTING.md#L78) [scripts/sync-flow-tests.cjs](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/scripts/sync-flow-tests.cjs)
- Integration tests cover CLI behaviors (check, write, cache, patterns, ignore, stdin, plugins, config-resolution, experimental-cli, node-version-check, help-options) with snapshot files under tests/integration/__tests__/__snapshots__/. — [tests/integration/__tests__/check.js](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/tests/integration/__tests__/check.js) [tests/integration/__tests__/write.js](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/tests/integration/__tests__/write.js) [tests/integration/__tests__/cache.js](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/tests/integration/__tests__/cache.js) [tests/integration/__tests__/experimental-cli.js](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/tests/integration/__tests__/experimental-cli.js) [tests/integration/__tests__/config-resolution.js](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/tests/integration/__tests__/config-resolution.js)
- Unit tests (tests/unit/) cover doc-printer, doc-builders, ast-path, visitor-keys, config-loader, resolve-parser, builtin-plugins, editorconfig-to-prettier, massage-ast; they are ignored when NODE_ENV=production. Bundle tests are ignored in development. — [tests/unit/doc-printer.js](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/tests/unit/doc-printer.js) [tests/unit/resolve-parser.js](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/tests/unit/resolve-parser.js) [tests/unit/config-loader.js](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/tests/unit/config-loader.js) [jest.config.js#L36-46](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/jest.config.js#L36-L46)
- Production Jest installs the built package via tests/config/install-prettier.js into a temp node_modules/prettier (unless SKIP_PRODUCTION_INSTALL); TEST_STANDALONE and TEST_RUNTIME=browser remap the entry and skip tests/integration/. Browser tests skip several plugin/front-matter format tests. — [jest.config.js#L7-60](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/jest.config.js#L7-L60) [tests/config/install-prettier.js](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/tests/config/install-prettier.js) [tests/config/prettier-entry.js](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/tests/config/prettier-entry.js)
- package.json test scripts: test=jest; test:dev-package=INSTALL_PACKAGE=1; test:production=NODE_ENV=production; test:production-standalone=TEST_STANDALONE=1; test:production:browser with TEST_RUNTIME_BROWSER chrome|firefox and TEST_BUNDLE_FORMAT umd. Coverage via c8 include src/** and bin/**. — [package.json#L202-210](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/package.json#L202-L210) [package.json#L240-260](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/package.json#L240-L260) [.github/workflows/dev-test.yml#L63-78](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/.github/workflows/dev-test.yml#L63-L78)
- Lint CI also runs yarn lint:format-test (scripts/format-test-lint.js), prettier check on docs with PRETTIER_DEBUG=true so embedded format errors throw, yarn lint:deps, tsc, knip (separate lint:knip script), and codecov upload of coverage/lcov.info. — [.github/workflows/lint.yml#L37-62](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/.github/workflows/lint.yml#L37-L62) [package.json#L216-224](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/package.json#L216-L224) [jest.config.js#L110-116](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/jest.config.js#L110-L116)
- Release-script tests live in scripts/release/tests/; dts tests in tests/dts/unit/run.js (skipped on Node <=14). Dummy plugins under tests/config/prettier-plugins/ exercise embed/async printer/missing comments. — [scripts/release/tests](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/scripts/release/tests) [tests/dts/unit/run.js](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/tests/dts/unit/run.js) [tests/config/prettier-plugins/prettier-plugin-uppercase-rocks/index.js](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/tests/config/prettier-plugins/prettier-plugin-uppercase-rocks/index.js) [jest.config.js#L70-80](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/jest.config.js#L70-L80)
- Prod CLI job runs dist/prettier on Node v0.10.48 solely to assert the engines check message 'Prettier requires at least version 14 of Node.js' — the production engine floor advertised by that job is 14, while package.json engines.node is >=22 for this source tree. — [.github/workflows/prod-test.yml#L204-238](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/.github/workflows/prod-test.yml#L204-L238) [package.json#L35-37](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/package.json#L35-L37) [bin/prettier.cjs#L43-56](https://github.com/prettier/prettier/blob/1a36a7defdcccfc4967e99bbf9517a02ab2345b2/bin/prettier.cjs#L43-L56)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
