Skip to content

Commit 3af3281

Browse files
committed
test(@angular-devkit/build-angular): use async expect in asset tests
1 parent 3c734a8 commit 3af3281

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

packages/angular_devkit/build_angular/src/browser/specs/assets_spec.ts

+4-8
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,8 @@ describe('Browser Builder assets', () => {
113113
};
114114

115115
const run = await architect.scheduleTarget(targetSpec, overrides);
116-
try {
117-
await run.result;
118-
expect('THE ABOVE LINE SHOULD THROW').toBe('');
119-
} catch {}
116+
117+
await expectAsync(run.result).toBeRejected();
120118

121119
// The node_modules folder must be deleted, otherwise code that tries to find the
122120
// node_modules folder will hit this one and can fail.
@@ -135,10 +133,8 @@ describe('Browser Builder assets', () => {
135133
};
136134

137135
const run = await architect.scheduleTarget(targetSpec, overrides);
138-
try {
139-
await run.result;
140-
expect('THE ABOVE LINE SHOULD THROW').toBe('');
141-
} catch {}
136+
137+
await expectAsync(run.result).toBeRejected();
142138

143139
// The node_modules folder must be deleted, otherwise code that tries to find the
144140
// node_modules folder will hit this one and can fail.

0 commit comments

Comments
 (0)