-
Notifications
You must be signed in to change notification settings - Fork 76
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 context in beforeEach call (unittest) #266
Fix context in beforeEach call (unittest) #266
Conversation
This was happen by the difference between Jasmin(CodePen) and Jest(Motocal) It's repored in official jest issue Jest fixed the re-use of `this` context as bug. (it's implicitly context binding to use `this` in test code) so Jasmin's test code does will not work in Jest. This patch is required in MotocalDevelopers#201
Neither solution fails for me. How do you reproduce this error? |
fail? at least current status is shown ok (TravisCI Details in this PR)
The error was produced 2492295 in #201, you can see the the full log in Travis CI detail I was missing to note that, this is patch to #201 (for now) then I will change PR title: The summary will be:
Problem is, non of current motocal code did not use import/export syntax. |
Oh okay, I pulled onto master and tried it. I'll try this PR changes on #201. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues. I can verify this patch fixes issue in #201
missing in MotocalDevelopers#266 I noticed after merged. this fix is required in MotocalDevelopers#201
missing in MotocalDevelopers#266 I noticed after merged. this fix is required in MotocalDevelopers#201
This was happen by the difference between Jasmin(CodePen) and Jest(Motocal)
It's repored in official jest issue jestjs/jest#3553
Jest fixed the re-use of
this
context as bug.(it's actually implicitly context binding to use
this
in test code)so Jasmin's test code will not work in Jest.
This patch is required in #201
Here is current #201 test result, it changes babel setting for jest (test only change)
This patch only change the test code, that just moving the variable context/scope.
No effects to Motocal main code at all. So it's safe to Approve if Travis status shows green.
@h-yasha just mention for update unit test info
my test code not work in Jest (maybe in future when library updated)
we can't writelet {variable} = this;
in Jest code anymore.we should not use
this
context variable in test code.