1 | import { expect } from 'chai';
|
2 | import sinon from 'sinon';
|
3 |
|
4 | import cookies from '../../../src/middleware/cookies';
|
5 |
|
6 | it('should assign a cookies property to the request', () => {
|
7 | const spy = sinon.spy();
|
8 | const app = cookies()({ request: spy });
|
9 | app.request({}, {});
|
10 | expect(spy).to.be.calledWithMatch(req => !!req.cookies);
|
11 | });
|