-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't work with babel-register #121
Comments
You need to register the source map support before babel register… |
@wmertens mmmm how ? example ? |
and all works. I think developers should write some about it in documentation. |
Oh wow, I spent all of yesterday trying to work this out! Any chance of adding it to the readme? |
@tamlyn how is it done without sails? |
fyi, babel-register includes support for source-map-support directly. https://github.com/babel/babel/blob/dc1f40540de11045bb4714350350e012fee4f93e/packages/babel-register/src/node.js#L11-L24 |
Referenced to get nyc/istanbul reporting properly with tests transpiled inline: https://github.com/react-bootstrap/react-prop-types (as of v0.4.0) Note on source maps: Source map support comes with `mocha --compilers js:babel-register`, which seems to enable source maps to work in tests but not in the compiled output. Adding `import 'source-map-support/register'` to the src enables source maps to work in compiled code but break in tests. Including source-map-support in src and requiring source-map-support before babel-register when running mocha (instead of passing the compilers option) appears to get both. Referenced to get source maps working in test and compiled output: evanw/node-source-map-support#121 Notes on coverage: nyc's "--all" option to include reports for files that are not required is currently not working with babel-plugin-istanbul, but they're aware of the matter. Also, including reporter settings in the nyc stanza of package.json appear to trample command line options, so those were moved to the npm test script instead. Related issues: istanbuljs/nyc#333 istanbuljs/babel-plugin-istanbul#4
Referenced to get nyc/istanbul reporting properly with tests transpiled inline: https://github.com/react-bootstrap/react-prop-types (as of v0.4.0) Note on source maps: Source map support comes with `mocha --compilers js:babel-register`, which seems to enable source maps to work in tests but not in the compiled output. Adding `import 'source-map-support/register'` to the src enables source maps to work in compiled code but break in tests. Including source-map-support in src and requiring source-map-support before babel-register when running mocha (instead of passing the compilers option) appears to get both. Referenced to get source maps working in test and compiled output: evanw/node-source-map-support#121 Notes on coverage: nyc's "--all" option to include reports for files that are not required is currently not working with babel-plugin-istanbul, but they're aware of the matter. Also, including reporter settings in the nyc stanza of package.json appear to trample command line options, so those were moved to the npm test script instead. Related issues: istanbuljs/nyc#333 istanbuljs/babel-plugin-istanbul#4
test.js:
error:
Compiled code:
The text was updated successfully, but these errors were encountered: