jest-module-field-resolver

0.0.1 • Public • Published

jest-module-field-resolver

This package is for jest to use packages that don't have main field in their package.json.

Usage

  1. install the package

    $ npm i -D jest-module-field-resolver
    
  2. add jest-module-field-resolver as the resolver of jest, and transformIgnorePattern so that the package missing main field can be transpiled correctly when running jest.

    In your package.json, please add them as follows:

    {
      ...
      "jest": {
        ...
        "transformIgnorePattern": "node_modules/(?!(package_1|package_2)/)",
        "resolver": "jest-module-field-resolver"
      }
    }

Note

Ref: https://github.com/facebook/jest/issues/2702#issuecomment-585595612

This is based on https://gist.github.com/loklaan/9fe7768576466c5a31c2e7af4cfdecd0.

Readme

Keywords

none

Package Sidebar

Install

npm i jest-module-field-resolver

Weekly Downloads

0

Version

0.0.1

License

Apache-2.0

Unpacked Size

3.05 kB

Total Files

3

Last publish

Collaborators

  • makotoshimazu