forked from electrode-io/electrode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[minor] Add chrome headless to component archetype (electrode-io#516)
- Loading branch information
Showing
5 changed files
with
50 additions
and
14 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
packages/electrode-archetype-react-component-dev/config/karma/browser-settings.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"use strict"; | ||
|
||
const archetype = require("electrode-archetype-react-component/config/archetype"); | ||
const browser = archetype.karma.browser.toLowerCase(); | ||
|
||
module.exports = function(settings) { | ||
if (browser === "chrome") { | ||
settings.browsers = ["ChromeHeadless"]; | ||
settings.frameworks = ["mocha"]; | ||
settings.crossOriginAttribute = false; | ||
console.log("Using Chrome Headless to run Karma test"); | ||
|
||
} else if (browser === "phantomjs") { | ||
settings.browsers = ["PhantomJS"]; | ||
settings.frameworks = ["mocha", "phantomjs-shim"]; | ||
console.warn( | ||
"Using PhantomJS to run Karma test. It's been deprecated and may be removed in the future." | ||
); | ||
} else { | ||
console.error(`Unknown browser ${browser} set for Karma test. Failed.`); | ||
return process.exit(1); | ||
} | ||
|
||
return settings; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters