{
  // THIS SHARED JEST CONFIGURATION FILE IS INTENDED TO BE REFERENCED BY THE JEST CONFIGURATION IN
  // CONSUMING PACKAGE AND REQUIRES PRESET-RELATIVE MODULE RESOLUTION TO BE ENABLED. IF YOU HAVE
  // DISABLED THIS FEATURE YOU MUST CREATE YOUR OWN JEST CONFIGURATION

  // By default, don't hide console output
  "silent": false,

  // In order for HeftJestReporter to receive console.log() events, we must set verbose=false
  "verbose": false,

  // If mocks are not cleared between tests, it opens the door to accidental reliance on
  // ordering of tests or describe blocks, eventually resulting in intermittent failures.
  //
  // We suggest this setting for any heft project (in a monorepo or not).
  "clearMocks": true,

  // "Adding '<rootDir>/lib' here enables lib/__mocks__ to be used for mocking Node.js system modules
  "roots": ["<rootDir>/lib"],

  "testMatch": ["<rootDir>/lib/**/*.test.{cjs,js}"],
  "testPathIgnorePatterns": ["/node_modules/"],

  // Code coverage tracking is disabled by default; set this to true to enable it
  "collectCoverage": false,

  "coverageDirectory": "<rootDir>/temp/coverage",

  // Use V8 instead of Babel to avoid the overhead of instrumenting code
  "coverageProvider": "v8",

  "collectCoverageFrom": [
    "lib/**/*.{cjs,js}",
    "!lib/**/*.d.ts",
    "!lib/**/*.test.{cjs,js}",
    "!lib/**/test/**",
    "!lib/**/__tests__/**",
    "!lib/**/__fixtures__/**",
    "!lib/**/__mocks__/**"
  ],
  "coveragePathIgnorePatterns": ["/node_modules/"],

  "testEnvironment": "jest-environment-node",

  "testEnvironmentOptions": {
    "url": "http://localhost/",
    "customExportConditions": ["require", "node"]
  },

  // Retain pre-Jest 29 snapshot behavior
  "snapshotFormat": {
    "escapeString": true,
    "printBasicPrototype": true
  },

  "snapshotResolver": "../lib-commonjs/exports/jest-source-map-snapshot-resolver.js",

  // Instruct jest not to run the transformer pipeline by default on JS files. The output files from TypeScript
  // will already be fully transformed, so this avoids redundant file system operations.
  "transformIgnorePatterns": ["\\.c?js$"],

  // jest-identity-mock-transform returns a proxy for exported key/value pairs, where Webpack would return a module
  // jest-string-mock-transform returns the filename, relative to the current working directory, where Webpack would return a URL
  // When using the heft-jest-plugin, these will be replaced with the resolved module location
  "transform": {
    "\\.(css|sass|scss)$": "../lib-commonjs/exports/jest-identity-mock-transform.js",

    "\\.(aac|eot|gif|jpeg|jpg|m4a|mp3|mp4|oga|otf|png|svg|ttf|wav|webm|webp|woff|woff2)$": "../lib-commonjs/exports/jest-string-mock-transform.js"
  },

  // The modulePathIgnorePatterns below accepts these sorts of paths:
  //   - <rootDir>/lib
  //   - <rootDir>/lib/file.js
  // ...and ignores anything else under <rootDir>
  "modulePathIgnorePatterns": [],

  // Prefer .cjs to .js to catch explicit commonjs output. Optimize for local files, which will be .js
  "moduleFileExtensions": ["cjs", "js", "json", "node"],

  // When using the heft-jest-plugin, these will be replaced with the resolved module location
  "resolver": "../lib-commonjs/exports/jest-improved-resolver.js"
}
