diff --git a/jest.config.js b/jest.config.js index 24d713c43..d3f3b7115 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,6 +1,7 @@ const jestConfig = require('kcd-scripts/jest') module.exports = Object.assign(jestConfig, { + testEnvironment: 'warpdom', coveragePathIgnorePatterns: [ ...jestConfig.coveragePathIgnorePatterns, '.macro.js$', diff --git a/other/misc-tests/jest.config.js b/other/misc-tests/jest.config.js index 08f06d7da..7101df888 100644 --- a/other/misc-tests/jest.config.js +++ b/other/misc-tests/jest.config.js @@ -3,7 +3,7 @@ const babelHelpersList = require('@babel/helpers').list module.exports = Object.assign(jestConfig, { roots: ['.'], - testEnvironment: 'jsdom', + testEnvironment: 'warpdom', transform: { '^.+\\.(js|jsx|mjs)$': ['babel-jest', {rootMode: 'upward'}], }, diff --git a/other/ssr/jest.config.js b/other/ssr/jest.config.js index 17153eeb1..37e45c78f 100644 --- a/other/ssr/jest.config.js +++ b/other/ssr/jest.config.js @@ -1,6 +1,6 @@ // This is separate because the test environment is set via the config -// and we want most of our tests to run with jsdom, but we still want -// to make sure that the server rendering use case continues to work. +// and we want most of our tests to run with a DOM (warpdom), but we still +// want to make sure that the server rendering use case continues to work. const jestConfig = require('kcd-scripts/config').jest module.exports = Object.assign(jestConfig, { diff --git a/package.json b/package.json index 2183e45ee..ceaa7f8fa 100644 --- a/package.json +++ b/package.json @@ -126,6 +126,7 @@ "flow-bin": "^0.299.0", "flow-coverage-report": "^0.8.0", "get-pkg-repo": "5.0.0", + "jest-environment-warpdom": "^0.1.0", "kcd-scripts": "^17.0.0", "node-polyfill-webpack-plugin": "^4.1.0", "npm-run-all": "^4.1.5", @@ -139,7 +140,8 @@ "react-test-renderer": "^18.3.1", "serve": "^14.2.5", "start-server-and-test": "^2.1.3", - "typescript": "^5.9.3" + "typescript": "^5.9.3", + "warpdom": "^0.1.3" }, "overrides": { "eslint-plugin-react-hooks": "^7.1.1"