1.0.5 • Published 6 years ago

babel-plugin-jest-test-exporter v1.0.5

Weekly downloads
18
License
No License
Repository
-
Last release
6 years ago

Jest test export

This plugin allows you to strip out exported 'private' functions during testing only.

In order to do this, you need to use a specific NODE_ENV environment variable to tell the plugin whether or not to strip out exports during babelifying.

package.json

"scripts": {
    "test": "export NODE_ENV=test ; jest"
}

Then within the plugin options set the corresponding options to reference that exported environment variable.

.babelrc

 "plugins": [
    [ "jest-test-exporter", { "NODE_ENV": "test" } ]
 ]