File size: 728 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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([])
    }
  })
})