forked from lit/lit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweb-test-runner.config.js
46 lines (43 loc) · 1.13 KB
/
web-test-runner.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
* @license
* Copyright 2022 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
import {chromeLauncher} from '@web/test-runner-chrome';
export default {
concurrency: 1,
testFramework: {
config: {
ui: 'bdd',
timeout: '2000',
// TODO(usergenic): Why does rootHooks not seem to register the beforeEach/afterEach hooks?
// I was hoping to register the ResizeObserver error ignore hooks here but the hook functions
// here don't appear to do anything.
rootHooks: [],
},
},
browsers: [
chromeLauncher({
async createPage({context}) {
const page = await context.newPage();
await page.evaluateOnNewDocument(provideSkipInCI, process.env.CI);
return page;
},
}),
],
};
function provideSkipInCI(CI) {
// We're extending Mocha's describe function, so
// need to wait until Mocha has loaded
addEventListener('load', () => {
// eslint-disable-next-line no-undef
const {describe} = globalThis;
describe.skipInCI = (title, fn) => {
if (CI) {
describe.skip(title, fn);
} else {
describe(title, fn);
}
};
});
}