Skip to content
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

Mocha and babel compiler warnings #144

Closed
nfischer opened this issue Jul 5, 2018 · 3 comments · Fixed by #145
Closed

Mocha and babel compiler warnings #144

nfischer opened this issue Jul 5, 2018 · 3 comments · Fixed by #145

Comments

@nfischer
Copy link
Member

nfischer commented Jul 5, 2018

I see the following output when I run npm test on node v4.8.7 and npm 5.8.0:

> shx@0.3.1 test [path redacted]/shx
> nyc --reporter=text --reporter=lcov mocha

"--compilers" will be removed in a future version of Mocha; see https://git.io/vdcSr for more info
Transformation error for [path redacted]/shx/src/shx.js ; return original code
Unexpected token ...
Transformation error for [path redacted]/shx/src/help.js ; return original code
Unexpected token ...
Transformation error for [path redacted]/shx/src/config.js ; return original code
Unexpected token ...
Transformation error for [path redacted]/shx/src/printCmdRet.js ; return original code
Unexpected token ...

We should find a way forward without the --compilers flag. The deprecation notice says this is only a warning, so we may have a different problem related to the "Transformation errors".

This blocks #142.

@nfischer
Copy link
Member Author

nfischer commented Jul 5, 2018

Seems like --compilers deprecation is indeed separate from the transformation errors from babel.

@nfischer
Copy link
Member Author

nfischer commented Jul 5, 2018

Culprit: PR #135


The --compilers warning happened when we bumped mocha to ^5.2.0 (not sure exactly which version). This is easy to fix (the deprecation link has clear instructions).


The Transformation error messages started with nyc ^12.0.0 (but are not present on ^11.0.0). The quick fix is to downgrade nyc.

@nfischer nfischer self-assigned this Jul 5, 2018
nfischer added a commit that referenced this issue Jul 5, 2018
This fixes 2 issues, both of which are vaguely related to babel
transpiling during tests:

 * The new mocha version uses the `--require` flag instead of
   `--compilers`.
 * nyc 12.0.0 causes mysterious "Transformation errors" with transpiling
   during tests.

This PR addresses the first issue by switching the flag as required.
This PR addresses the second issue by downgrading nyc, as it's not clear
if nyc or our project is the real culprit.

Fixes #144
@nfischer
Copy link
Member Author

nfischer commented Jul 5, 2018

The answer to the nyc issue is in the changelog. nyc@11 is the last release with node v4/v5 support.

nfischer added a commit that referenced this issue Jul 10, 2018
This fixes 2 issues, both of which are vaguely related to babel
transpiling during tests:

 * The new mocha version uses the `--require` flag instead of
   `--compilers`.
 * nyc 12.0.0 causes mysterious "Transformation errors" with transpiling
   during tests.

This PR addresses the first issue by switching the flag as required.
This PR addresses the second issue by downgrading nyc, as v11 is the
last release which supports node v4.

Fixes #144
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant