update test

This commit is contained in:
dojineko 2018-02-01 21:20:44 +09:00
parent 4fb644fdb3
commit 2899212040

View File

@ -26,7 +26,10 @@ test.serial('Init Nuxt.js', async t => {
render: { render: {
csp: { csp: {
enabled: true, enabled: true,
allowedSources: ['https://example.com', 'https://example.io'] policies: {
'default-src': [`'none'`],
'script-src': ['https://example.com', 'https://example.io']
}
} }
} }
} }
@ -258,6 +261,7 @@ test('Content-Security-Policy Header', async t => {
resolveWithFullResponse: true resolveWithFullResponse: true
}) })
// Verify functionality // Verify functionality
t.regex(headers['content-security-policy'], /default-src 'none'/)
t.regex(headers['content-security-policy'], /script-src 'self' 'sha256-.*'/) t.regex(headers['content-security-policy'], /script-src 'self' 'sha256-.*'/)
t.true(headers['content-security-policy'].includes('https://example.com')) t.true(headers['content-security-policy'].includes('https://example.com'))
t.true(headers['content-security-policy'].includes('https://example.io')) t.true(headers['content-security-policy'].includes('https://example.io'))