$ git clone https://gist.github.com/820f6232acc6f53bd1e57d21b09e1f89.git
$ cd 820f6232acc6f53bd1e57d21b09e1f89
$ npm i && npm test
Last active
October 22, 2022 14:13
-
-
Save dantman/820f6232acc6f53bd1e57d21b09e1f89 to your computer and use it in GitHub Desktop.
babel-jest Babel 7 node_modules import issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"presets": [ | |
[ | |
"@babel/preset-env", | |
{ | |
"modules": "commonjs" | |
} | |
] | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import difference from 'lodash-es/difference'; | |
export default difference(['a'], ['b']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import index from "./index"; | |
test("Index exists", () => { | |
expect(index).toBeDefined(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "babel-jest-node_modules-import", | |
"version": "1.0.0", | |
"description": "Test case", | |
"main": "index.js", | |
"scripts": { | |
"test": "jest" | |
}, | |
"dependencies": { | |
"@babel/core": "7.0.0-beta.47", | |
"@babel/preset-env": "7.0.0-beta.47", | |
"babel-core": "7.0.0-bridge.0", | |
"babel-jest": "latest", | |
"jest": "22.4.4", | |
"lodash-es": "latest" | |
}, | |
"jest": { | |
"transform": { | |
"^.+\\.(mjs|jsx|js)$": "babel-jest" | |
}, | |
"transformIgnorePatterns": [ | |
"node_modules/(?!(lodash-es)/)" | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment