Reusable Jest configuration.
npm install --save-dev @asd14/jest-configIn your jest.config.js file, add the following:
import baseConfig from "@asd14/jest-config"
/** @satisfies {import("@jest/types").Config.InitialOptions} */
export default /** @type {const} */ ({
...baseConfig,
testEnvironment: "jsdom"
})What baseConfig does:
- Resolve
@d41/*and@asd14/*monorepo packages; - Allow importing
*.jsextension files which are problematic since Jest parsessrcfiles and those*.jsfiles might not yet be transpiled. - Enforce 95% coverage threshold
