Skip to content

Commit

Permalink
feat: disable tab throttling (#144)
Browse files Browse the repository at this point in the history
Closes #137
  • Loading branch information
brendonbribeiro authored and gregberge committed Sep 30, 2018
1 parent 0cf7109 commit b92e76c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
16 changes: 10 additions & 6 deletions packages/jest-environment-puppeteer/src/readConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ const DEFAULT_CONFIG = {
browserContext: 'default',
exitOnPageError: true,
}
const DEFAULT_CONFIG_CI = {
const DEFAULT_CONFIG_CI = merge(DEFAULT_CONFIG, {
launch: {
args: ['--no-sandbox', '--disable-setuid-sandbox'],
},
browserContext: 'default',
exitOnPageError: true,
}
args: [
'--no-sandbox',
'--disable-setuid-sandbox',
'--disable-background-timer-throttling',
'--disable-backgrounding-occluded-windows',
'--disable-renderer-backgrounding'
],
}
})

async function readConfig() {
const defaultConfig =
Expand Down
13 changes: 13 additions & 0 deletions packages/jest-environment-puppeteer/tests/readConfig.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,18 @@ describe('readConfig', () => {
const config = await readConfig()
expect(config.server).not.toBeDefined()
})

it('should return default config with launch args', async () => {
mockExists(false)
process.env.CI = true
const config = await readConfig()
expect(config.launch.args).toEqual([
'--no-sandbox',
'--disable-setuid-sandbox',
'--disable-background-timer-throttling',
'--disable-backgrounding-occluded-windows',
'--disable-renderer-backgrounding'
])
})
})
})

0 comments on commit b92e76c

Please sign in to comment.