UNPKG

356 BJavaScriptView Raw
1import { expect } from 'chai';
2import sinon from 'sinon';
3
4import secure from '../../../src/middleware/secure';
5
6it('should enable strict transport security', () => {
7 const spy = sinon.spy();
8 const app = secure({ secure: true })({ request: spy });
9 app.request({}, { setHeader: spy });
10 expect(spy).to.be.calledWith('Strict-Transport-Security');
11});