-
Notifications
You must be signed in to change notification settings - Fork 408
Jasmine 3.0.0 breaks Angular 5.2 tests #1015
Comments
The variable |
I will check it, thank you! |
@rnadler , I have found the reason and will provide a PR soon. |
@JiaLiPassion I just tried your changes and they mostly work. My tests which don't use a |
@dfederm , could you post a reproduce repo? I haven't tried with |
@JiaLiPassion looks like it's throwing here:
The repro is actually really simple:
PS. I'm not very versed in zone.js, so please excuse any naivete on my part. |
@dfederm , ok , thank you for the debug information, I will check it. |
@JiaLiPassion so I started deleting more and more code to help narrow it down and realized I lied a little. My tests actually have a
If I remove that, it seems to work. So it seems like something goes awry if I do something angular-ish and async in the Also, this doesn't solve the problem, but in jasmine-patch.js if I replace
with
I get a real failure instead of the test being excluded silently. |
@JiaLiPassion I just tried your latest changes that handles child zones and my tests now pass! Assuming that's the "right" fix and not a temp hack you were just playing with. |
@dfederm , thank you for quick confirm, yes, check |
Don't know if it can help but I have the same issue with the version 3.0.0: All logs are visible on the pull request that tries to update Jasmine here: Indeed I also have a beforeEach with async in my tests |
@proustibat , the |
@JiaLiPassion I'm not meaning to badger you but was wondering what the status was on a fix and if you had an ETA for getting this merged in and package pushed. I only ask so I can evaluate whether it's worth it for me to push a private package with your pending fix just for myself to use temporarily, or whether I should just wait for an official fix. Thanks again for your hard work on this issue! |
@dfederm , sure, you can use this temp branch for test now, just update your
you can test with current status of PR. I will still need to test this PR for little more, please use this branch for now. |
why is this closed, please? |
@andreimcristof , this issue have been fixed, but not released. you can use |
@JiaLiPassion I moved to the branch as you suggested and it throws the following exception
that seems similar to this other issue #399 any ideas? |
… in all stark packages and starter (#267) * feat(stark-testing): create separate stark-testing package. Replace testing specific dependencies by stark-testing in all stark packages and starter. Fixes #68. [#68][#84][#93] * chore(stark-testing): upgrade dependencies in stark-testing package. Upgrade @types/node in all packages * fix(stark-testing): downgrade 'jasmine-core' dependency due to an issue with Zone.js (angular/zone.js#1015) * fix(starter): clean up tsconfig.spec.json for unit testing
* feat(stark-testing): create separate stark-testing package. Replace testing specific dependencies by stark-testing in all stark packages and starter. Fixes #68. [#68][#84][#93] * chore(stark-testing): upgrade dependencies in stark-testing package. Upgrade @types/node in all packages * fix(stark-testing): downgrade 'jasmine-core' dependency due to an issue with Zone.js (angular/zone.js#1015) * fix(starter): clean up tsconfig.spec.json for unit testing * fix(http): fix unit tests. Enhance http demo in Starter [#96]
Can this maybe not be closed until this fix is released? |
no idea why ng team releases untested configurations then takes months to resolve fixes: angular/zone.js#1015
Why is this closed? The issue still exists in the latest revision of stable releases from all components notes (zone.js, rxjs, jasmine). |
@corvinrok , @alexzaytsev-newsroomly , please wait for the next release. you can use
for test now. |
When is the next release going to be? |
Thanks very much @JiaLiPassion , the fix works perfectly for me. |
For the people watching this issue, the fix appears to have been released so you can remove the hack in your package.json. https://github.com/angular/zone.js/blob/master/CHANGELOG.md#0821-2018-03-30 |
Updating zone.js to the latest version worked for me |
[Zone.js issue #1015](angular/zone.js#1015)
[Zone.js issue #1015](angular/zone.js#1015)
I can confirm: |
A few test cases are still failing after using the above versions. Before upgrading zone.js and jasmine-core, all specs used to pass. Most of the failing ones have 'toBe' and 'toEqual' assertions. It seems the specs are not being tested in order, for example in a describe block with 3 'It' functions, the third(or the second, I found it to be inconsistent) 'It' is being tested first thereby assigning a value to a variable |
@ssunny2 , this is |
@roinou, thank you for confirmation. |
@JiaLiPassion Thanks for the clarification. I do understand why it's not recommended,but could you please tell me where I can configure the specs to run in order. |
@ssunny2 , sure, you can find it here, https://jasmine.github.io/setup/nodejs.html |
I looked up the file, and found that random is already set to false
on running the test by appending --random:false also didn't yield the expected result. Some specs are still failing. |
I am not sure which part is wrong, you can try to downgrade to |
OK I'll try the steps you suggested, although I'm sure its the TCs that are having conficts with jasmine 3.x. I can't post the repo here though, it isn't my personal project. Thanks for the help. |
Found a way to disable random mode by jasmine for angular (6 in my case). Put this in karma.conf.js:
|
I am facing the same issue. I upgraded from Angular 5.2 to Angular 6 and my all the unit tests are breaking apart randomly. I even tried setting up the random mode by jasmine as per @denisbeklarov comment. But its still failing. I tried to use the |
@chetankh23, what is the error information? |
no idea why ng team releases untested configurations then takes months to resolve fixes: angular/zone.js#1015
no idea why ng team releases untested configurations then takes months to resolve fixes: angular/zone.js#1015
Duplicated from: jasmine/jasmine#1496
Expected Behavior
Tests work with Jasmine 2.9.1
Current Behavior
With Jasmine 3.0.0, all tests fail with this error:
Same behavior using Angular 5.2.3 and 5.2.4.
It seems as though jasmine-patch.js is no longer compatible with Jasmine 3.0.0.
Your Environment
Ubuntu 16.04
Chrome 64.0.3282 (Linux)
package.json: "zone.js": "^0.8.20"
ng -v
The text was updated successfully, but these errors were encountered: