1.0.0 • Published 9 years ago
babel-jest-import-glob v1.0.0
babel-jest-import-glob
Wrapper of babel-jest that makes jest aware of wildcard glob imports using babel-plugin-import-glob.
babel-jest assumes a file is idempotent. When using babel-plugin-import-glob
an added or deleted file can change the transform. But babe-jest has no
way to pick up on this since the original file has not changed.
This wrapper looks for wildcard glob imports and uses
glob to prepend a comment block above
the file content. This allows babel-jest to see that the file needs
to be transformed again.
Installation
npm install --save-dev babel-jest-import-globUsage
package.json
{
"jest": {
"transform": {
"^.+\\.jsx?$": "babel-jest-import-glob"
}
}
}1.0.0
9 years ago