diff --git a/tests/unit/resources/methods.test.ts b/tests/unit/resources/methods.test.ts index 69940336..a3b95809 100644 --- a/tests/unit/resources/methods.test.ts +++ b/tests/unit/resources/methods.test.ts @@ -22,7 +22,7 @@ describe('methods', () => { mock.onGet(`/methods/${methodId}`).reply(200, response._embedded.methods[0], {}); mock.onGet('/methods/foo').reply(500, error, {}); - it('should return a method instance', () => + it('should return a method instance', () => methods.get(methodId).then(result => { expect(result).toMatchSnapshot(); })); @@ -35,19 +35,19 @@ describe('methods', () => { }); }); - it('should throw an error for non-existent IDs', () => + it('should throw an error for non-existent IDs', () => methods .get('foo') .then(result => expect(result).toBeUndefined()) .catch(err => { expect(err).toBeInstanceOf(ApiError); - expect(err.getMessage()).toEqual(error.detail); + expect(err.message).toEqual(error.detail); })); it('should return an error with a callback for non-existent IDs', done => { methods.get('foo', {}, (err: any, result) => { expect(err).toBeInstanceOf(ApiError); - expect(err.getMessage()).toEqual(error.detail); + expect(err.message).toEqual(error.detail); expect(result).toBeUndefined(); done(); });