Skip to content

Commit f633960

Browse files
committed
refactor(@schematics/angular): tidy up
1 parent a84bf1f commit f633960

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

packages/schematics/angular/refactor/jasmine-vitest/transformers/fake-async-flush.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ export function transformFakeAsyncFlush(node: ts.Node, ctx: RefactorContext): ts
5454
return awaitRunAllTimersAsync;
5555
} else {
5656
// If `flush` is not used as its own statement, then the return value is probably used.
57-
// Therefore, we replace it with nullish coalescing that returns 0.
57+
// Therefore, we replace it with nullish coalescing that returns 0:
58+
// > await vi.runAllTimersAsync() ?? 0;
5859
ctx.reporter.recordTodo('flush-return-value', ctx.sourceFile, node);
5960
addTodoComment(node, 'flush-return-value');
6061

packages/schematics/angular/refactor/jasmine-vitest/transformers/fake-async-test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,7 @@ export function transformFakeAsyncTest(node: ts.Node, ctx: RefactorContext): ts.
6969
ts.factory.createBlock([
7070
ts.factory.createExpressionStatement(
7171
ts.factory.createCallExpression(
72-
ts.factory.createPropertyAccessExpression(
73-
ts.factory.createIdentifier('vi'),
74-
'useRealTimers',
75-
),
72+
ts.factory.createPropertyAccessExpression(vi, 'useRealTimers'),
7673
undefined,
7774
[],
7875
),

0 commit comments

Comments
 (0)