Skip to content

Commit

Permalink
fix spec
Browse files Browse the repository at this point in the history
  • Loading branch information
mdnorman committed Apr 14, 2020
1 parent 4640dde commit 5afb4f3
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions spec/unit/services/helloWorld.spec.ts
Expand Up @@ -52,15 +52,8 @@ describe('helloWorld', () => {

describe('with bad input', () => {
it('should throw error', async () => {
try {
const result = await helloWorld('BAD!');
fail(`No error thrown. Got result: ${result}`);
} catch (e) {
expect(e).not.toBeNull();
expect(e).toEqual(jasmine.any(ArgumentError));
expect(e.message).toContain('Bad word given');
expect(e.message).toContain('BAD!');
}
await expect(helloWorld('BAD!')).rejects.toThrowError('Bad word given');
await expect(helloWorld('BAD!')).rejects.toThrowError('BAD!');
});
});
});

0 comments on commit 5afb4f3

Please sign in to comment.