jsconfig-paths-jest-mapper

1.0.0 • Public • Published

jsconfig-paths-jest-mapper

Use this to load modules whose location is specified in the paths section of jsconfig.json when using jest.

How to install

yarn add --dev jsconfig-paths-jest-mapper

or

npm install --save-dev jsconfig-paths-jest-mapper

How to use

In your jest config add this:

const JsConfigPathsMapper = require('jsconfig-paths-jest-mapper');

module.exports = {
  ...
  moduleNameMapper: new JsConfigPathsMapper(/* { configFileName: "path/to/jsconfig.json" } */);
  ...
}

Options

configFile (string) (default='jsconfig.json')

Allows you to specify where to find the configuration file.

How to test

To run the provided tests:

yarn test

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    525
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    525

Package Sidebar

Install

npm i jsconfig-paths-jest-mapper

Weekly Downloads

449

Version

1.0.0

License

MIT

Last publish

Collaborators

  • galy4a