-
Notifications
You must be signed in to change notification settings - Fork 3
/
test.js
33 lines (27 loc) · 760 Bytes
/
test.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
var xFrameOptionsHeader = require('./')
, request = require('supertest')
, express = require('express')
describe('X-Frame-Options header middleware', function () {
it('should add the header to all responses', function (done) {
var app = express()
app.use(xFrameOptionsHeader())
request(app)
.get('/')
.expect('X-Frame-Options', 'Deny')
.end(function (err) {
if (err) throw err
done()
})
})
it('should allow the value to be overridden', function (done) {
var app = express()
app.use(xFrameOptionsHeader('Sameorigin'))
request(app)
.get('/')
.expect('X-Frame-Options', 'Sameorigin')
.end(function (err) {
if (err) throw err
done()
})
})
})