Skip to content

Commit

Permalink
fix(cdk/testing): TestbedHarnessEnvironment should work when Zone is …
Browse files Browse the repository at this point in the history
…not present

This commit fixes the harness environment which assumes Zone is always
defined on the page.
  • Loading branch information
atscott committed Jun 3, 2024
1 parent eb22e2e commit c539194
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cdk/testing/testbed/testbed-harness-environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function uninstallAutoChangeDetectionStatusHandler(fixture: ComponentFixture<unk

/** Whether we are currently in the fake async zone. */
function isInFakeAsyncZone() {
return Zone!.current.get('FakeAsyncTestZoneSpec') != null;
return typeof Zone !== 'undefined' || Zone!.current.get('FakeAsyncTestZoneSpec') != null;
}

/**
Expand Down

0 comments on commit c539194

Please sign in to comment.