@@ -20,8 +20,20 @@ const coverageReporter: ReporterDescription = [
2020 ignore them here. */
2121 "codap-plugin-starter-project/src/codap/**"
2222 ] ,
23+ /* Modify the paths of files on which coverage is reported. This is run after
24+ the exclude filter, so it does not get any of the codap3 files.
25+ The paths returned by the v8 coverage have two issues which at least make them
26+ break the html report. They have an extra prefix of the project name so they
27+ look like `codap-plugin-starter-project/codap-plugin-starter-project/src`. They
28+ have a suffix like `?[random string]` like `App.tsx?c341`. */
29+ rewritePath : ( { absolutePath} ) => {
30+ // It isn't clear if this is before or after the exclude rule
31+ return ( absolutePath as string )
32+ . replace ( "codap-plugin-starter-project/" , "" )
33+ . replace ( / \? [ 0 - 9 a - z ] + $ / , "" ) ;
34+ } ,
2335 /* Directory in which to write coverage reports */
24- resultDir : path . join ( __dirname , "results/e2e- coverage" ) ,
36+ resultDir : path . join ( __dirname , "playwright" , " coverage") ,
2537 /* Configure the reports to generate.
2638 The value is an array of istanbul reports, with optional configuration attached. */
2739 reports : [
@@ -50,7 +62,7 @@ const coverageReporter: ReporterDescription = [
5062/* We report json in CI so the `daun/playwright-report-summary` action can add a summary of
5163 the results to a PR comment. */
5264const reportJson = ! ! process . env . CI ;
53- const jsonReporter : ReporterDescription = [ "json" , { outputFile : " results.json" } ] ;
65+ const jsonReporter : ReporterDescription = [ "json" , { outputFile : path . join ( "playwright" , " results.json") } ] ;
5466
5567/**
5668 * See https://playwright.dev/docs/test-configuration.
@@ -68,6 +80,7 @@ export default defineConfig<PlaywrightCoverageOptions>({
6880 /* Reporter to use. See https://playwright.dev/docs/test-reporters */
6981 reporter : [
7082 [ "html" ] ,
83+ [ "list" ] ,
7184 ...( collectCoverage ? [ coverageReporter ] : [ ] ) ,
7285 ...( reportJson ? [ jsonReporter ] : [ ] ) ,
7386 ] ,
0 commit comments