mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
48725b22c7
A clean revert of the revert #77339 of #74815 Closes PACK-3715
24 lines
728 B
TypeScript
24 lines
728 B
TypeScript
import { nextTestSetup } from 'e2e-utils'
|
|
|
|
describe('Document and App - With CSP enabled', () => {
|
|
const { next } = nextTestSetup({
|
|
files: __dirname,
|
|
})
|
|
|
|
it('should load inline script by hash', async () => {
|
|
const browser = await next.browser('/?withCSP=hash')
|
|
if (global.browserName === 'chrome') {
|
|
const errLog = await browser.log()
|
|
expect(errLog.filter((e) => e.source === 'security')).toEqual([])
|
|
}
|
|
})
|
|
|
|
it('should load inline script by nonce', async () => {
|
|
const browser = await next.browser('/?withCSP=nonce')
|
|
if (global.browserName === 'chrome') {
|
|
const errLog = await browser.log()
|
|
expect(errLog.filter((e) => e.source === 'security')).toEqual([])
|
|
}
|
|
})
|
|
})
|