Karma-Chromium-Edge-Launcher
Launcher for Chromium Edge Canary, Dev, Beta and Stable channels for Windows OS, Mac OS and Linux OS
Available in NPM Registry
Installation
Install the package as dev-dependency
npm i -D @chiragrupani/karma-chromium-edge-launcher
Configuration
Update Karma.conf.js
replace or append to array of browsers and add require plugin as below:
// karma.conf.js
module.exports = function (config) {
config.set({
- browsers: ['Chrome'],
+ browsers: ['Edge'],
plugins: [
- require('karma-chrome-launcher'),
+ require('@chiragrupani/karma-chromium-edge-launcher'),
],
});
};
Following browser channels are supported, add corresponding string in browsers:
- "Edge"
- "EdgeDev"
- "EdgeBeta"
- "EdgeCanary"
If you want to launch browser in headless mode, below is correspondling list:
- "EdgeHeadless"
- "EdgeDevHeadless"
- "EdgeBetaHeadless"
- "EdgeCanaryHeadless"
If you want to explicity specify the path for browser installation, set environment variable from this list, corresponding to release channel:
EDGE_BIN, EDGE_BETA_BIN, EDGE_DEV_BIN, EDGE_CANARY_BIN
Example:
process.env.EDGE_DEV_BIN =
"C:\\Program Files (x86)\\Microsoft\\Edge Dev\\Application\\msedge.exe";
That's all is required to use Karma with Chromium Edge browser.
The browser can also be specified with npm test
commmand like below:
"coverage": "ng t --no-watch --code-coverage --reporters=junit,coverage-istanbul --browsers=EdgeHeadless --progress=false"
Build from Source
In case if you want to build package from github source
npm install
npm run package
npm install -g <path/to/tgz>
The project is based on karma-chrome-launcher
as most of flags/configs for Chromium Edge are similar to Chrome browser
For more information on Karma see the homepage.