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

exports points to module.exports but not the other way around #29

Open
goatslacker opened this issue Mar 11, 2012 · 4 comments
Open

exports points to module.exports but not the other way around #29

goatslacker opened this issue Mar 11, 2012 · 4 comments
Labels

Comments

@goatslacker
Copy link
Contributor

Related to GH-22

I noticed this bug while I was writing the failing test

Basically, this line has to be context.module.exports and cannot be context.exports

This is because context.exports = context.module.exports but when context.module.exports is assigned, it doesn't reflect in context.exports

Solution: wrap the code using Module.wrap and pass in module.exports as exports and module as module

edit:

err...just realized you can't wrap the code since that's just the way coveraje works. Hmmmm

WolfgangKluge added a commit that referenced this issue Mar 11, 2012
@WolfgangKluge
Copy link
Member

Can't reproduce.
I added a test here 107d56b

edit: now I got it... change inside test runner...
edit 2: no - still can't reproduce - I had a typo in my extended test case first ;)

@goatslacker
Copy link
Contributor Author

I'll add a failing test

goatslacker added a commit to goatslacker/coveraje that referenced this issue Mar 12, 2012
@goatslacker
Copy link
Contributor Author

So I know coveraje works without wrapping the node code (instead exporting all vars into the context) but I think that approach is broken. Node should function like node, where the code is wrapped and everything returned is via module.exports or exports

This will add some inconsistency so perhaps it's best to split up into a different function -- like cover.coverNode ??

@WolfgangKluge
Copy link
Member

OK, confirmend now. Sorry, I just didn't get it ;)

Hope we find another solution...

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

No branches or pull requests

2 participants