jest-fixed-happy-dom
v0.0.2
Published
A superset of the happy-dom environment for Jest that respects Node.js globals.
Maintainers
Readme
jest-fixed-happy-dom
A superset of the happy-dom environment for Jest that respects Node.js globals.
[!WARNING] This package is never meant as a solution to anything. This is a workaround. Please consider testing browser code in the actual browser. You can do so both in Vitest and in Playwright at the moment.
This is a fork of the https://github.com/mswjs/jest-fixed-jsdom package and does the same thing but for happy-dom instead of JSDOM. Please read their README for details.
Getting started
Install
npm i jest-fixed-happy-dom --save-devConfigure Jest
In your jest.config.js, set the testEnvironment option to jest-fixed-happy-dom:
// jest.config.js
module.exports = {
testEnvironment: 'jest-fixed-happy-dom',
}You can use any other
testEnvironmentOptionsyou need. Those will be forwarded to the underlyingjest-environment-happy-dom.
