jest-inspect-hooks

1.1.1 • Public • Published

Jest Inspect Hooks

Usage

In your jest.config.js:

module.exports = {
  // (Required) Ensures the use of the original `global.console`
  testEnvironment: "jest-inspect-hooks/testEnvironment/NodeEnvironment",

  // (Required) Ensures the use of the original `global.console`
  setupTestFrameworkScriptFile: "jest-inspect-hooks/setupTestFrameworkScriptFile",
  
  // (Optional) This will place a `debugger` statement at test completion
  // This allows you to inspect `console` logs before terminating the process
  globalTeardown: "jest-inspect-hooks/globalTeardown",
}

VSCode

Try this launch.json:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "name": "Jest Inspect",
      "request": "launch",
      "protocol": "inspector",
      "args": [ "--runInBand" ],
      "console": "internalConsole",
      "autoAttachChildProcesses": true,
      "smartStep": true,
      "program": "${workspaceFolder}/node_modules/jest/bin/jest"
    }
  ]
}
  

Environments

There are a few environments supplied. These require the respective peer dependency to work, though.

module.exports = {
  testEnvironment: "jest-inspect-hooks/testEnvironment/NodeEnvironment",
  testEnvironment: "jest-inspect-hooks/testEnvironment/JsdomEnvironment",
}

Readme

Keywords

none

Package Sidebar

Install

npm i jest-inspect-hooks

Weekly Downloads

0

Version

1.1.1

License

MIT

Unpacked Size

33.4 kB

Total Files

7

Last publish

Collaborators

  • nfour