Support jest 28 to 30#56
Conversation
b80e78f to
a92f960
Compare
| For Node-based tests: | ||
|
|
||
| ```shell | ||
| pnpm add -D jest jest-environment-node |
There was a problem hiding this comment.
~ Should we show these examples installing a particular major version?
There was a problem hiding this comment.
We could add it, but usually node users know how to target specific versions using @ .
There was a problem hiding this comment.
My expectation is that people will copy/paste the command. Or leave it to a LLM to copy/paste the command.
There was a problem hiding this comment.
A LLM should be able to determine which version of the environment is required and how to install it. However, I can add a more specific example so people don't have to look for the documentation or search the web on how to do that.
There was a problem hiding this comment.
Added an example to README.md.
|
|
||
| execSync( | ||
| `pnpm jest --config="${configFile}" --no-cache --silent=false --useStderr`, | ||
| `node "${install.bin}" --config="${configFile}" --no-cache --silent=false --useStderr`, |
There was a problem hiding this comment.
~ Is there a reason for the switch away from pnpm?
There was a problem hiding this comment.
Here we need to use node to directly invoke a specific version of jest. pnpm can't do that it would always call jest 30, the one we use for actually running the integration test.
| env: { | ||
| ...process.env, | ||
| NODE_OPTIONS: '--experimental-vm-modules', | ||
| env: childEnv({ |
There was a problem hiding this comment.
~ what's the benefit of the childEnv fn?
There was a problem hiding this comment.
It was used for more complex env manipulation, but I guess we can remove it, since it's only doing simple env manipulation now.
5419c67 to
af2f265
Compare
af2f265 to
cd5ad47
Compare
Moves jest-environment-jsdom and jest-environment-node from dependencies to peerDependencies so consumers control which jest version is installed.
Supports jest 28, 29, and 30.
BREAKING CHANGE: consumers must now install the jest environment package themselves.
Updated README.md with installation instructions. Requires a major version bump.