Download next.js/test/e2e/app-document/csp.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 728 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-document/csp.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/e2e/app-document/csp.test.ts
-
curl -L -o csp.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-document/csp.test.ts
728 Bytes
| 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([]) | |
| } | |
| }) | |
| }) | |