Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

Latest commit

 

History

History
20 lines (18 loc) · 928 Bytes

README.md

File metadata and controls

20 lines (18 loc) · 928 Bytes

jest-sourcemaps

Use Jest with sourcemaps

This package contains a few utilities to add source map support to jest. To use it you must:

  • install: npm install jest-sourcemaps
  • override the test Environment: Add "testEnvironment": "jest-sourcemaps/lib/jsdom-env" or "testEnvironment": "jest-sourcemaps/lib/node-env" to your jest config in your package.json.
  • replace babel-jest: Use the transformer here instead by adding "\\.jsx?$": "jest-sourcemaps/lib/transformer.js" to your jest.transform config.
  • add the source-map-support hook by either setting "setupTestFrameworkScriptFile": "jest-sourcemaps/lib/testEnvSetup.js" in your jest config, or by requiring the module from your existing setup file
  • make babel output sourcemaps: Set "sourceMaps": "both" in your .babelrc
  • disable jest's cache: Run it with --no-cache