Repository navigation
Expand file tree
/
Copy pathplaywright.coverage.config.js
More file actions
53 lines (49 loc) · 1.88 KB
/
Copy pathplaywright.coverage.config.js
File metadata and controls
53 lines (49 loc) · 1.88 KB
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
import process from 'node:process';
import { defineConfig } from '@playwright/test';
import baseConfig from './playwright.config.js';
process.env.FROST_UI_AUTHCODEINPUT_COVERAGE = 'true';
const normalizePath = (filePath) => filePath.replaceAll('\\', '/');
const sourceMapUrl = new URL('./dist/frost-ui-authcodeinput.js.map', import.meta.url).href;
export default defineConfig({
...baseConfig,
projects: [
{
name: 'coverage',
use: {
browserName: 'chromium',
permissions: [
'clipboard-read',
],
},
},
],
reporter: [
['line'],
[
'monocart-reporter',
{
name: 'Frost UI AuthCodeInput Coverage',
outputFile: './test-results/coverage/index.html',
coverage: {
name: 'Frost UI AuthCodeInput Source Coverage',
outputDir: './coverage',
reports: [
'console-summary',
'html',
'lcovonly',
],
entryFilter: (entry) => normalizePath(entry.url).endsWith('/assets/frost-ui-authcodeinput.js'),
sourceFilter: (sourcePath) => {
const normalizedPath = normalizePath(sourcePath);
// The browser entry only re-exports the component, so bundling
// erases it and V8 cannot associate runtime ranges with the file.
return normalizedPath.startsWith('src/') &&
normalizedPath !== 'src/browser.js';
},
sourceMapResolver: (_url, defaultResolver) => defaultResolver(sourceMapUrl),
all: './src',
},
},
],
],
});