-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: provide a way to run tests in automatic mode
BREAKING CHANGE: ngx-speculoos now allows running test in _automatic_ mode. in this mode, instead of imperatively triggering a change detection, you await the stability and thus let Angular decide if a CD is necessary or not. See the "Upgrading to v13" section of the README for details.
- Loading branch information
Showing
16 changed files
with
690 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core'; | ||
import { ComponentFixtureAutoDetect } from '@angular/core/testing'; | ||
|
||
const COMPONENT_FIXTURE_AUTO_DETECTION: EnvironmentProviders = makeEnvironmentProviders([ | ||
{ provide: ComponentFixtureAutoDetect, useValue: true } | ||
]); | ||
|
||
/** | ||
* Provide function which returns the provider `{ provide: ComponentFixtureAutoDetect, useValue: true }`. | ||
* This provider can be added to the testing module to configure the component testers | ||
* (and the underlying ComponentFixture) in automatic mode: | ||
* | ||
* ``` | ||
* TestBed.configureTestingModule({ providers: [provideAutomaticChangeDetection()] }); | ||
* ``` | ||
*/ | ||
export function provideAutomaticChangeDetection(): EnvironmentProviders { | ||
return COMPONENT_FIXTURE_AUTO_DETECTION; | ||
} |
Oops, something went wrong.