Skip to content
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.

Use headless Chrome instead of PhantomJS to run tests 🤖 #337

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/configure-karma/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@ const buildStandardKarmaConfig = (saguiConfig, webpackConfig) => {

basePath: projectPath,

browsers: ['PhantomJS'],
browsers: ['Chrome_headless'],

// you can define custom flags
customLaunchers: {
Chrome_headless: {
base: 'ChromeCanary',
flags: ['--headless', '--remote-debugging-port=9222', 'http://0.0.0.0:9876/']
}
},

reporters: [
'mocha',
Expand Down
2 changes: 1 addition & 1 deletion src/configure-karma/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('karma', function () {

describe('extension', function () {
it('should allow overwriting the default configuration', function () {
expect(karma(baseSaguiConfig, webpackConfig).browsers).eql(['PhantomJS'])
expect(karma(baseSaguiConfig, webpackConfig).browsers).eql(['Chrome_headless'])
expect(karma({ ...baseSaguiConfig, additionalKarmaConfig: { browsers: ['Chrome'] } }, webpackConfig).browsers).eql(['Chrome'])
})
})
Expand Down