-
Notifications
You must be signed in to change notification settings - Fork 326
/
jest-puppeteer.config.js
47 lines (40 loc) · 1.04 KB
/
jest-puppeteer.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const devServerOptions = require('./jest-dev-server.config.js')
/**
* @type {import('jest-environment-puppeteer').JestPuppeteerConfig}
*/
module.exports = {
browserContext: 'incognito',
/**
* Workaround for jest-environment-puppeteer 'uncaughtException'
* see error handling in '@govuk-frontend/helpers/jest/environment/puppeteer.mjs'
*/
exitOnPageError: false,
/**
* Puppeteer launch options
*/
launch: {
args: [
/**
* Allow tests to use file:// paths
*/
'--allow-file-access-from-files',
/**
* Prevent empty Chrome startup window
* Tests use their own `browser.newPage()` instead
*/
'--no-startup-window'
],
/**
* Allow headless mode switching using `HEADLESS=false`
*
* {@link https://developer.chrome.com/articles/new-headless/}
*/
headless: process.env.HEADLESS !== 'false',
// See launch arg '--no-startup-window'
waitForInitialPage: false
},
/**
* Development server options
*/
server: devServerOptions
}