Skip to content

Commit

Permalink
add test cases for preload directive
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Płaczek authored and erdtman committed Nov 5, 2020
1 parent e35d83a commit bcf4f04
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/index.js
Expand Up @@ -64,3 +64,28 @@ test('include subdomains', t => {
t.is(result.name, 'Strict-Transport-Security');
t.is(result.value, 'max-age=456789; includeSubDomains');
});

test('preload', t => {
const sts = STS.getSTS({
'max-age': 456789,
'preload': true
});
const result = {};
sts(null, getRes(result), next);

t.is(result.name, 'Strict-Transport-Security');
t.is(result.value, 'max-age=456789; preload');
});

test('include subdomains and preload', t => {
const sts = STS.getSTS({
'max-age': 456789,
'includeSubDomains': true,
'preload': true
});
const result = {};
sts(null, getRes(result), next);

t.is(result.name, 'Strict-Transport-Security');
t.is(result.value, 'max-age=456789; includeSubDomains; preload');
});

0 comments on commit bcf4f04

Please sign in to comment.