-
Notifications
You must be signed in to change notification settings - Fork 0
/
web-test-runner.config.mjs
44 lines (41 loc) · 1.12 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
import { esbuildPlugin } from '@web/dev-server-esbuild';
import rdfjs from 'rdfjs-eds-plugin'
import { fromRollup } from '@web/dev-server-rollup'
import commonjs from '@rollup/plugin-commonjs'
import fs from 'fs'
import turtle from '@roadshow/build-helpers/transformTurtle.js'
const nodeResolveFix = {
serve(context) {
if (context.path.includes('node_modules') && context.path.endsWith('.ts')) {
const path = `.${context.request.url}`.replace(/\.ts$/,'.js')
const body = fs.readFileSync(path)
return { body, type: 'js' };
}
}
}
const config = {
groups: [
{ name: 'core', files: 'packages/roadshow/test/**/*.test.ts' },
],
mimeTypes: {
'**/*.ttl': 'js',
'**/*.trig': 'js',
},
coverage: true,
nodeResolve: true,
plugins: [
esbuildPlugin({ ts: true, js: true, target: 'auto' }),
nodeResolveFix,
rdfjs,
fromRollup(turtle)(),
fromRollup(commonjs)({
exclude: [
'**/node_modules/@open-wc/**/*',
'**/node_modules/chai/**/*',
'**/node_modules/chai-dom/**/*',
'**/node_modules/sinon-chai/**/*',
]
}),
],
};
export default config