Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

fix(ngMock): don't clean up if currentSpec is null. #16856

Open
wants to merge 1 commit into
base: v1.6.x
Choose a base branch
from

Commits on Mar 22, 2019

  1. fix(ngMock): 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.
    heathkit committed Mar 22, 2019
    Configuration menu
    Copy the full SHA
    6bbc865 View commit details
    Browse the repository at this point in the history