Package Exports
- @babel/helper-plugin-test-runner
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@babel/helper-plugin-test-runner) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@babel/helper-plugin-test-runner
NOTE: This is an internal Babel module and may not work outside. Use at your own risk.
Usage:
Check Babel for an example: https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-exponentiation-operator/test
- Inside a
/test
directory, add anindex.js
with the contentsrequire("@babel/helper-plugin-test-runner")(__dirname);
. - Inside
/test/fixtures
, create a folder for each suite (eg; one suite for each feature of your plugin). - Suite folders may contain files and folders. Files will be transformed and run; use
expect()
assertions to verify correct behavior. Folders may containinput.js
,output.js
, and/orexec.js
. The output of transforminginput.js
will be checked to match the contents ofoutput.js
.exec.js
, if it exists, will be transformed and run, as with a file in the suite folder. - Install and run
mocha
. - To run a specific test, run
mocha --grep testName
.