The `jest-environment-node-debug-fixed` package was developed to resolve debugging challenges encountered when using Jest versions up to around 19 with Node.js 7. It provided a specialized test environment to facilitate debugging, especially with external tools like `devtool` or the native Node.js Inspector. This 'fixed' version aimed to patch compatibility issues that prevented seamless debugging in those specific, older environments. However, with significant advancements in Jest (currently stable at 30.x) and Node.js, native debugging capabilities have become robust and universally supported. Modern Jest integrates directly with Node's inspector protocol, enabling streamlined debugging through IDEs like VS Code or browser developer tools without the need for custom environments. The package's release cadence was ad-hoc, responding to specific compatibility hurdles of its era, and it has not been updated to support contemporary Jest or Node.js versions, making it largely obsolete for current development workflows.
npm install jest-environment-node-debugVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to configure Jest to use `jest-environment-node-debug-fixed` and initiate a debugging session using Node's inspector with a simple TypeScript test file.
Remove `jest-environment-node-debug-fixed` from `devDependencies` and `jest.config.js`. Use native Jest debugging with `node --inspect-brk node_modules/.bin/jest --runInBand` and configure your IDE (VS Code, IntelliJ) as per Jest documentation.
Verify your Jest and Node.js versions. If using modern versions, switch to native Jest debugging. If you are restricted to ancient versions, ensure compatibility with Node.js 7 and Jest 18/19.
Ensure `npm install jest-environment-node-debug-fixed --save-dev` has been run and the `testEnvironment` path in `jest.config.js` correctly points to the package name.
Ensure Jest is run with `--runInBand` (e.g., `node --inspect-brk node_modules/.bin/jest --runInBand`). Also, verify your IDE's debugger configuration or open `chrome://inspect` and connect to the correct Node.js process. Adding a `debugger;` statement directly in your test code can force a pause and confirm debugger attachment.