JSPM

jsconfig-paths-jest-mapper

1.0.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 527
    • Score
      100M100P100Q117263F
    • License MIT

    Package Exports

    • jsconfig-paths-jest-mapper

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jsconfig-paths-jest-mapper) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    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