UNPKG

333 BJavaScriptView Raw
1import { expect } from 'chai';
2import sinon from 'sinon';
3
4import cookies from '../../../src/middleware/cookies';
5
6it('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});