Skip to content

Commit 5afb4f3

Browse files
committed
fix spec
1 parent 4640dde commit 5afb4f3

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

spec/unit/services/helloWorld.spec.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,8 @@ describe('helloWorld', () => {
5252

5353
describe('with bad input', () => {
5454
it('should throw error', async () => {
55-
try {
56-
const result = await helloWorld('BAD!');
57-
fail(`No error thrown. Got result: ${result}`);
58-
} catch (e) {
59-
expect(e).not.toBeNull();
60-
expect(e).toEqual(jasmine.any(ArgumentError));
61-
expect(e.message).toContain('Bad word given');
62-
expect(e.message).toContain('BAD!');
63-
}
55+
await expect(helloWorld('BAD!')).rejects.toThrowError('Bad word given');
56+
await expect(helloWorld('BAD!')).rejects.toThrowError('BAD!');
6457
});
6558
});
6659
});

0 commit comments

Comments
 (0)