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

fix: work with source maps when wrapped (mocha-env-loader) #238

Merged
merged 2 commits into from
Nov 10, 2017

Conversation

tschaub
Copy link
Contributor

@tschaub tschaub commented Apr 19, 2017

Notable Changes

When mocha is wrapped and a sourcemap is present, the mocha-env-loader tries to call SourceNode.fromSourceWithMap(content, map).

The SourceNode.fromSourceWithMap() function isn't defined in source-map@0.1.41 (I'm not sure if it was ever part of that library).

I've updated the dependency to source-map@0.5.6 and adapted the code to the new API.

This gets rid of the TypeError: SourceNode.fromSourceWithMap is not a function from the log and reveals Error: callback(): The callback was already called. instead. Assuming the intention was to return after calling the callback, I added a return.

Code

See https://gist.github.com/tschaub/b7700159dad789c4a0b91f2038dd0f58 for steps to reproduce.

Issues

ℹ️ edited by @michael-ciniawsky (Formatting)

@jsf-clabot
Copy link

jsf-clabot commented Apr 19, 2017

CLA assistant check
All committers have signed the CLA.

 * Work with source maps

 * Avoid calling callback twice
@tappleby
Copy link

Ran into this issue today, is there any updates on this?

I have been making changes to our webpack config and its using the array format now for different bundle outputs.

@michael-ciniawsky michael-ciniawsky changed the title fix: work with sourcemaps when mocha is wrapped fix: work with source maps when wrapped (mocha-env-loader) Oct 11, 2017
Copy link
Contributor

@michael-ciniawsky michael-ciniawsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tschaub Thx

@tschaub
Copy link
Contributor Author

tschaub commented Nov 8, 2017

Let me know if you need anything else from me here.

@joshwiens joshwiens merged commit c952bcd into codymikol:master Nov 10, 2017
@joshwiens
Copy link
Contributor

@tschaub @tappleby - Available in v2.0.6

@michael-ciniawsky michael-ciniawsky removed this from the 2.0.7 milestone Nov 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants