Skip to content

Commit b92e76c

Browse files
brendonbribeirogregberge
authored andcommitted
feat: disable tab throttling (#144)
Closes #137
1 parent 0cf7109 commit b92e76c

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

packages/jest-environment-puppeteer/src/readConfig.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@ const DEFAULT_CONFIG = {
1111
browserContext: 'default',
1212
exitOnPageError: true,
1313
}
14-
const DEFAULT_CONFIG_CI = {
14+
const DEFAULT_CONFIG_CI = merge(DEFAULT_CONFIG, {
1515
launch: {
16-
args: ['--no-sandbox', '--disable-setuid-sandbox'],
17-
},
18-
browserContext: 'default',
19-
exitOnPageError: true,
20-
}
16+
args: [
17+
'--no-sandbox',
18+
'--disable-setuid-sandbox',
19+
'--disable-background-timer-throttling',
20+
'--disable-backgrounding-occluded-windows',
21+
'--disable-renderer-backgrounding'
22+
],
23+
}
24+
})
2125

2226
async function readConfig() {
2327
const defaultConfig =

packages/jest-environment-puppeteer/tests/readConfig.test.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,18 @@ describe('readConfig', () => {
5454
const config = await readConfig()
5555
expect(config.server).not.toBeDefined()
5656
})
57+
58+
it('should return default config with launch args', async () => {
59+
mockExists(false)
60+
process.env.CI = true
61+
const config = await readConfig()
62+
expect(config.launch.args).toEqual([
63+
'--no-sandbox',
64+
'--disable-setuid-sandbox',
65+
'--disable-background-timer-throttling',
66+
'--disable-backgrounding-occluded-windows',
67+
'--disable-renderer-backgrounding'
68+
])
69+
})
5770
})
5871
})

0 commit comments

Comments
 (0)