Skip to content

[release/7.0] Update karma.local.conf.js #53410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 17, 2024
Merged
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
19 changes: 17 additions & 2 deletions src/SignalR/clients/ts/FunctionalTests/scripts/karma.local.conf.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const os = require('os');

try {
// Karma configuration for a local run (the default)
const createKarmaConfig = require("./karma.base.conf");
Expand Down Expand Up @@ -45,8 +47,16 @@ try {
// We use the launchers themselves to figure out if the browser exists. It's a bit sneaky, but it works.
tryAddBrowser("ChromeHeadlessNoSandbox", ChromeHeadlessBrowser.prototype);
tryAddBrowser("ChromiumHeadlessIgnoreCert", ChromiumHeadlessBrowser.prototype);
if (!tryAddBrowser("FirefoxHeadless", FirefoxHeadlessBrowser.prototype)) {
tryAddBrowser("FirefoxDeveloperHeadless", FirefoxDeveloperHeadlessBrowser.prototype);

if (os.platform() !== 'darwin') {
if (!tryAddBrowser("FirefoxHeadless", FirefoxHeadlessBrowser.prototype)) {
tryAddBrowser("FirefoxDeveloperHeadless", FirefoxDeveloperHeadlessBrowser.prototype);
}
} else {
// https://bugzilla.mozilla.org/show_bug.cgi?id=1871366
// https://bugzilla.mozilla.org/show_bug.cgi?id=1871447
// It looks like some Entitlements issue with Firefox and macOS, additionally, it seems 'firefox-bin' is being removed which is what the karma firefox launcher uses by default
tryAddBrowser("FirefoxHeadlessMac", FirefoxHeadlessBrowser.prototype);
}

// We need to receive an argument from the caller, but globals don't seem to work, so we use an environment variable.
Expand All @@ -71,6 +81,11 @@ try {

// Ignore cert errors to allow our test cert to work (NEVER do this outside of testing)
flags: ["--allow-insecure-localhost", "--ignore-certificate-errors"]
},
FirefoxHeadlessMac: {
base: 'FirefoxHeadless',

command: '/Applications/FireFox.app/Contents/MacOS/firefox'
}
},
});
Expand Down