import { NotFoundError } from '../../src'; describe('Not found Error', () => { const message = 'Route not found'; const otherMessage = 'Route test not found'; it('should return statusCode 404', done => { const notFound = new NotFoundError(); expect(notFound.statusCode).toEqual(404); done(); }); it('should return default message', done => { const notFound = new NotFoundError(); expect(notFound.message).toEqual(message); done(); }); it('should return a serialize default message', done => { const notFound = new NotFoundError(); expect(notFound.serializeErrors()).toMatchObject([{ message }]); done(); }); it('should return a message', done => { const notFound = new NotFoundError(otherMessage); expect(notFound.message).toEqual(otherMessage); done(); }); it('should return a serialize message', done => { const notFound = new NotFoundError(otherMessage); expect(notFound.serializeErrors()).toMatchObject([ { message: otherMessage }, ]); done(); }); });