Skip to content

Commit

Permalink
Detect Chromium Edge with the plugin @chiragrupani/karma-chromium-edg…
Browse files Browse the repository at this point in the history
…e-launcher
  • Loading branch information
aleen42 committed Mar 9, 2021
1 parent 332b4bd commit 9101780
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = function(config) {

plugins: [
'karma-chrome-launcher',
'karma-edge-launcher',
'@chiragrupani/karma-chromium-edge-launcher',
'karma-firefox-launcher',
'karma-ie-launcher',
'karma-safari-launcher',
Expand Down Expand Up @@ -103,7 +103,7 @@ module.exports = function(config) {

plugins: [
'karma-chrome-launcher',
'karma-edge-launcher',
'@chiragrupani/karma-chromium-edge-launcher',
'karma-firefox-launcher',
'karma-ie-launcher',
'karma-safari-launcher',
Expand Down
17 changes: 11 additions & 6 deletions browsers/Edge.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
var CMD;
var linux, darwin, win32;

try {
CMD = require.resolve('edge-launcher/dist/x86/MicrosoftEdgeLauncher.exe');
} catch (e) {
CMD = '';
}
var CMD = require('@chiragrupani/karma-chromium-edge-launcher')['launcher:Edge'][1].prototype.DEFAULT_CMD;
linux = CMD.linux, darwin = CMD.darwin, win32 = CMD.win32;
} catch (ignore) {}

try {
win32 = require.resolve('edge-launcher/dist/x86/MicrosoftEdgeLauncher.exe');
} catch (ignore) {}

module.exports = {
name: 'Edge',
DEFAULT_CMD: {
win32: [CMD]
linux: [linux || ''],
darwin: [darwin || ''],
win32: [win32 || '']
},
ENV_CMD: 'EDGE_BIN'
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"jasmine-core": "^3.1.0",
"karma": "^2.0.0",
"karma-chrome-launcher": "*",
"karma-edge-launcher": "*",
"@chiragrupani/karma-chromium-edge-launcher": "*",
"karma-firefox-launcher": "*",
"karma-ie-launcher": "*",
"karma-jasmine": "^1.1.0",
Expand Down

0 comments on commit 9101780

Please sign in to comment.