angular-cn/packages/core/schematics/migrations/wait-for-async
Kristiyan Kostadinov 5ce71e0fbc feat(core): add automated migration to replace async with waitForAsync (#39212)
Adds a migration that finds all imports and calls to the deprecated `async` function from
`@angular/core/testing` and replaces them with `waitForAsync`.

These changes also move a bit of code out of the `Renderer2` migration so that it can be reused.

PR Close #39212
2020-10-13 09:55:34 -07:00
..
BUILD.bazel feat(core): add automated migration to replace async with waitForAsync (#39212) 2020-10-13 09:55:34 -07:00
README.md feat(core): add automated migration to replace async with waitForAsync (#39212) 2020-10-13 09:55:34 -07:00
index.ts feat(core): add automated migration to replace async with waitForAsync (#39212) 2020-10-13 09:55:34 -07:00
util.ts feat(core): add automated migration to replace async with waitForAsync (#39212) 2020-10-13 09:55:34 -07:00

README.md

async -> waitForAsync migration

Automatically migrates from async to waitForAsync by changing function calls and renaming imports.

Before

import { async } from '@angular/core/testing';

it('should work', async(() => {
  // async testing logic
}));

After

import { waitForAsync } from '@angular/core/testing';

it('should work', waitForAsync(() => {
  // async testing logic
}));