Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Transformation error #1

Closed
shannonmoeller opened this issue Apr 28, 2015 · 6 comments
Closed

Transformation error #1

shannonmoeller opened this issue Apr 28, 2015 · 6 comments

Comments

@shannonmoeller
Copy link

Any idea what's causing this?

https://travis-ci.org/douglasduteil/study-node-path-es6/jobs/57027484#L144-L150

I get the same error when running this locally in my project.

babel-node ./node_modules/.bin/isparta cover --report text --report lcov ./node_modules/.bin/_mocha
@douglasduteil
Copy link
Owner

wow dunno... I will investigate. Thanks

@shannonmoeller
Copy link
Author

Anything?

@tysoncadenhead
Copy link

I'm seeing that issue too on my project. For some reason, the _mocha script has a return inside an if statement. I'm not sure if Mocha intends for that script to be wrapped or something, but the issue is definitely with a return happening directly inside the global context.

@shannonmoeller
Copy link
Author

The return is totally valid in a Node context. It's just weird that _mocha is being treated as ES6. Stuff in node_modules usually isn't parsed by babel-node, but in this case we're reaching into node_modules directly so it doesn't know to skip it.

@thegoleffect
Copy link

douglasduteil/isparta#47

following instructions in the above link and cloning latest mocha solved the problem for me (as of this post, the mochajs team has not published the hotfix to npm yet)

@douglasduteil
Copy link
Owner

Hi @shannonmoeller @tysoncadenhead @thegoleffect

After some code surfing 🏄
I found out that the problem comes form the istanbul default exclusion pattern that don't match for node_modules/.bin/_mocha

Here is deduction http://tonicdev.com/douglasduteil/isparta-68-transformation-error-return-original-code

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants