1 | import { expect } from 'chai';
|
2 | import sinon from 'sinon';
|
3 |
|
4 | import empty from '../../../src/middleware/empty';
|
5 |
|
6 | it('should `404` by default', () => {
|
7 | const spy = sinon.spy();
|
8 | const res = { end: spy };
|
9 | const app = empty();
|
10 | app.request({}, res);
|
11 | expect(res).to.have.property('statusCode', 404);
|
12 | });
|
13 |
|
14 | it('should throw errors it encounters', () => {
|
15 | const app = empty();
|
16 | expect(() => {
|
17 | app.error(new Error());
|
18 | }).to.throw(Error);
|
19 | });
|