forked from krakenjs/lusca
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
36 lines (26 loc) · 880 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*global describe:false, it:false */
'use strict';
var lusca = require('../index'),
request = require('supertest'),
assert = require('assert'),
mock = require('./mocks/app');
describe('All', function () {
it('method', function () {
assert(typeof lusca === 'function');
});
it('headers', function (done) {
var config = require('./mocks/config/all'),
app = mock(config);
app.get('/', function (req, res) {
res.status(200).end();
});
request(app)
.get('/')
.expect('X-FRAME-OPTIONS', config.xframe)
.expect('P3P', config.p3p)
.expect('Strict-Transport-Security', 'max-age=' + config.hsts.maxAge)
.expect('Content-Security-Policy-Report-Only', 'default-src *; report-uri ' + config.csp.reportUri)
.expect('X-XSS-Protection', '1; mode=block')
.expect(200, done);
});
});