Skip to content

Commit 98fa323

Browse files
committed
fix (test): update CSP tests for CDN directives and file hash
Signed-off-by: Max Wu <[email protected]>
1 parent 1417f65 commit 98fa323

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/csp.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ describe('Content security policies', function () {
4949
csp = mock.reRequire('../lib/csp')
5050

5151
assert(!csp.computeDirectives().scriptSrc.includes('https://cdnjs.cloudflare.com'))
52+
assert(!csp.computeDirectives().scriptSrc.includes('https://cdn.jsdelivr.net'))
5253
assert(!csp.computeDirectives().scriptSrc.includes('https://cdn.mathjax.org'))
5354
assert(!csp.computeDirectives().styleSrc.includes('https://cdnjs.cloudflare.com'))
55+
assert(!csp.computeDirectives().styleSrc.includes('https://cdn.jsdelivr.net'))
5456
assert(!csp.computeDirectives().styleSrc.includes('https://fonts.googleapis.com'))
5557
assert(!csp.computeDirectives().fontSrc.includes('https://cdnjs.cloudflare.com'))
5658
assert(!csp.computeDirectives().fontSrc.includes('https://fonts.gstatic.com'))
@@ -119,6 +121,6 @@ describe('Content security policies', function () {
119121
it('Unchanged hash for reveal.js speaker notes plugin', function () {
120122
const hash = crypto.createHash('sha1')
121123
hash.update(fs.readFileSync(path.resolve(__dirname, '../node_modules/reveal.js/plugin/notes/notes.html'), 'utf8'), 'utf8')
122-
assert.strictEqual(hash.digest('hex'), '471f3826880fac884a4a14faabc492bc854ae994')
124+
assert.strictEqual(hash.digest('hex'), 'd5d872ae49b5db27f638b152e6e528837204d380')
123125
})
124126
})

0 commit comments

Comments
 (0)