mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Removes usages of zone-based helpers such as `fakeAsync` , `tick` `waitForAsync` as part of the migration to zoneless tests. Completes the transition to zoneless.
23 lines
521 B
TypeScript
23 lines
521 B
TypeScript
/**
|
|
* @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.dev/license
|
|
*/
|
|
|
|
export async function timeout(ms?: number): Promise<void> {
|
|
return new Promise((resolve) => {
|
|
setTimeout(resolve, ms);
|
|
});
|
|
}
|
|
|
|
export function useAutoTick() {
|
|
beforeEach(() => {
|
|
jasmine.clock().install();
|
|
jasmine.clock().autoTick();
|
|
});
|
|
afterEach(() => {
|
|
jasmine.clock().uninstall();
|
|
});
|
|
}
|