Skip to content

Commit

Permalink
refactor(core): private export token to disable `fixture.detectChange…
Browse files Browse the repository at this point in the history
…s` error

While we do want to discourage `fixture.detectChanges`, it is yet to be
determined how this should be accomplished (warning, documentation, etc.). At
the moment, not being able to disable the error at all is entirely
prohibitive for existing test suites to use zoneless change detection in
tests.
  • Loading branch information
atscott committed Mar 28, 2024
1 parent dc604c2 commit 324a313
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
9 changes: 9 additions & 0 deletions packages/core/testing/private_export.ts
@@ -0,0 +1,9 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/

export {AllowDetectChangesAndAcknowledgeItCanHideApplicationBugs as ɵAllowDetectChangesAndAcknowledgeItCanHideApplicationBugs} from './src/test_bed_common';
5 changes: 2 additions & 3 deletions packages/core/testing/src/fake_async.ts
Expand Up @@ -26,10 +26,9 @@ export function resetFakeAsyncZone(): void {
}

export function resetFakeAsyncZoneIfExists(): void {
if (!fakeAsyncTestModule) {
return;
if (fakeAsyncTestModule) {
fakeAsyncTestModule.resetFakeAsyncZone();
}
fakeAsyncTestModule.resetFakeAsyncZone();
}

/**
Expand Down

0 comments on commit 324a313

Please sign in to comment.