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