Skip to content

Commit d8d732b

Browse files
authored
Merge pull request #84 from github/theinterned/chrome-no-sandbox
fix karma tests in codespaces not running ddue to missing `--no-sandbox`
2 parents 2be255e + 8757c9c commit d8d732b

3 files changed

Lines changed: 22 additions & 11 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
2828
"remoteUser": "node",
2929
"features": {
30-
"git": "latest"
30+
"git": "latest",
31+
"github-cli": "latest"
3132
}
3233
}

examples/index.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html>
33
<head>
44
<title>Auto-complete examples</title>
5-
<meta charset="utf-8">
5+
<meta charset="utf-8" />
66
<style>
7-
auto-complete [aria-selected="true"],
8-
auto-complete [role="option"]:hover {
7+
auto-complete [aria-selected='true'],
8+
auto-complete [role='option']:hover {
99
background-color: lavender;
1010
}
11-
auto-complete [aria-disabled="true"] {
11+
auto-complete [aria-disabled='true'] {
1212
color: grey;
1313
}
1414
</style>
@@ -42,7 +42,7 @@
4242
<label id="robots-label" for="robot">Robots</label>
4343
<!-- To enable auto-select (select first on Enter), use data-autoselect="true" -->
4444
<auto-complete src="/demo" for="items-popup" aria-labelledby="robots-label" data-autoselect="true">
45-
<input name="robot" type="text" aria-labelledby="robots-label" autofocus>
45+
<input name="robot" type="text" aria-labelledby="robots-label" autofocus />
4646
<!-- if a clear button is passed in, recommended to be *before* UL elements to avoid conflicting with their blur logic -->
4747
<button id="robot-clear">x</button>
4848
<ul id="items-popup"></ul>
@@ -60,7 +60,7 @@
6060
<label id="robots-a-label" for="robot-a">Robots (using Input ID)</label>
6161
<!-- To enable auto-select (select first on Enter), use data-autoselect="true" -->
6262
<auto-complete src="/demo" for="items-a-popup" aria-labelledby="robots-a-label" data-autoselect="true">
63-
<input id="robot-a" name="robot-a" type="text" aria-labelledby="robots-a-label" autofocus>
63+
<input id="robot-a" name="robot-a" type="text" aria-labelledby="robots-a-label" autofocus />
6464
<!-- if a clear button is passed in, recommended to be *before* UL elements to avoid conflicting with their blur logic -->
6565
<button id="robot-a-clear">x</button>
6666
<ul id="items-a-popup"></ul>
@@ -76,8 +76,8 @@
7676
<!-- example without autoselect -->
7777
<form>
7878
<label id="robots-2-label" for="robot-2">Robots (without autoselect on enter)</label>
79-
<auto-complete src="/demo" for="items-2-popup" aria-labelledby="robots-2-label" >
80-
<input name="robot-2" type="text" aria-labelledby="robots-2-label" autofocus>
79+
<auto-complete src="/demo" for="items-2-popup" aria-labelledby="robots-2-label">
80+
<input name="robot-2" type="text" aria-labelledby="robots-2-label" autofocus />
8181
<ul id="items-2-popup"></ul>
8282
<div id="items-2-popup-feedback" class="sr-only"></div>
8383
</auto-complete>

karma.config.cjs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* eslint-disable filenames/match-regex */
2+
3+
// eslint-disable-next-line import/no-commonjs, no-undef, @typescript-eslint/no-var-requires
14
process.env.CHROME_BIN = require('chromium').path
25

36
function completer(request, response, next) {
@@ -15,6 +18,7 @@ function completer(request, response, next) {
1518
next()
1619
}
1720

21+
// eslint-disable-next-line import/no-commonjs, no-undef
1822
module.exports = function (config) {
1923
config.set({
2024
frameworks: ['mocha', 'chai'],
@@ -29,7 +33,13 @@ module.exports = function (config) {
2933
port: 9876,
3034
colors: true,
3135
logLevel: config.LOG_INFO,
32-
browsers: ['ChromeHeadless'],
36+
browsers: ['ChromeHeadlessNoSandbox'],
37+
customLaunchers: {
38+
ChromeHeadlessNoSandbox: {
39+
base: 'ChromeHeadless',
40+
flags: ['--no-sandbox']
41+
}
42+
},
3343
autoWatch: false,
3444
singleRun: true,
3545
concurrency: Infinity,

0 commit comments

Comments
 (0)