We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4640dde commit 5afb4f3Copy full SHA for 5afb4f3
spec/unit/services/helloWorld.spec.ts
@@ -52,15 +52,8 @@ describe('helloWorld', () => {
52
53
describe('with bad input', () => {
54
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
- }
+ await expect(helloWorld('BAD!')).rejects.toThrowError('Bad word given');
+ await expect(helloWorld('BAD!')).rejects.toThrowError('BAD!');
64
});
65
66
0 commit comments