-
Notifications
You must be signed in to change notification settings - Fork 50
/
web-test-runner.config.mjs
60 lines (56 loc) · 1.48 KB
/
web-test-runner.config.mjs
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// eslint-disable-next-line import/no-extraneous-dependencies
import { importMapsPlugin } from '@web/dev-server-import-maps';
async function enableCORS(context, next) {
await next();
context.set('Access-Control-Allow-Credentials', true);
context.set('Access-Control-Allow-Origin', context.request.headers.origin);
}
const swcImportMaps = Object.fromEntries([
'theme.js',
'search.js',
'checkbox.js',
'dialog.js',
'base.js',
'reactive-controllers.js',
'shared.js',
'textfield.js',
'button.js',
'icons-workflow.js',
'icons-ui.js',
'checkmark.js',
'dash.js',
'divider.js',
'button-group.js',
'alert-dialog.js',
'underlay.js',
'help-text.js',
'icon.js',
'icons/checkmark.js',
'icons/dash.js',
'icons/cross.js',
].map((file) => [`/libs/features/spectrum-web-components/dist/${file}`, `/node_modules/@adobecom/milo/libs/features/spectrum-web-components/dist/${file}`]));
const miloImportMaps = { 'libs/': 'https://main--milo--adobecom.hlx.live/libs/' };
export default {
coverageConfig: {
include: ['creativecloud/**'],
exclude: ['test/mocks/**', 'test/**', '**/node_modules/**', 'creativecloud/deps/**'],
},
debug: false,
files: ['test/**/*.test.(js|html)'],
nodeResolve: true,
middlewares: [enableCORS],
plugins: [
importMapsPlugin({
inject: {
importMap: {
imports: {
...swcImportMaps,
...miloImportMaps,
},
},
},
}),
],
port: 2000,
browserLogs: false,
};