1.0.0 • Published 7 years ago

babel-jest-import-glob v1.0.0

Weekly downloads
49
License
ISC
Repository
github
Last release
7 years ago

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-glob

Usage

package.json

{
	"jest": {
		"transform": {
			"^.+\\.jsx?$": "babel-jest-import-glob"
		}
	}
}