This repository was archived by the owner on Apr 12, 2024. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork27.4k
Commit91a91b6
committed
fix(ngMock): Don't clean up if currentSpec is null.
In unit tests that use Angular and AngularJS, sometimes an error beingthrown during the test and cause this afterEach hook to run twice. Ifthat happens, on the second run cleanup will throw an error, since atthat point currentSpec is null. This causes the original error to behidden by a "TypeError: Cannot read property '$injector' of null whiletesting" error.This makes cleanup safe to call multiple times, working around theissue.1 parent33b5c50 commit91a91b6
1 file changed
+3
-0
lines changedLines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3000 | 3000 |
| |
3001 | 3001 |
| |
3002 | 3002 |
| |
| 3003 | + | |
| 3004 | + | |
| 3005 | + | |
3003 | 3006 |
| |
3004 | 3007 |
| |
3005 | 3008 |
| |
|
0 commit comments
Comments
(0)