This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Commit a9ae79c
committed
fix(ngMocks): Don't clean up if currentSpec is null.
In unit tests that use Angular and AngularJS, sometimes an error being
thrown during the test and cause this afterEach hook to run twice. If
that happens, on the second run cleanup will throw an error, since at
that point currentSpec is null. This causes the original error to be
hidden by a "TypeError: Cannot read property '$injector' of null while
testing" error.
This makes cleanup safe to call multiple times, working around the
issue.1 parent 33b5c50 commit a9ae79c
1 file changed
+3
-0
lines changed| 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