Tilted sphere with longitudinal stripes Modern Web Guides Docs Blog Toggle darkmode

Reporters: JUnit

JUnit XML reporter for web test runner

Configuration

Web test runner JUnit reporter accepts two options:

OptionTypeDefaultDescription
outputPathstring'./test-results.xml'file path (including extension) to write results to. Will be resolved from cwd.
reportLogsbooleanfalseWhether to report browser logs in the xml file's system-out element

Example

import { defaultReporter } from '@web/test-runner';
import { junitReporter } from '@web/test-runner-junit-reporter';

export default {
  nodeResolve: true,
  reporters: [
    // use the default reporter only for reporting test progress
    defaultReporter({ reportTestResults: false, reportTestProgress: true }),
    // use another reporter to report test results
    junitReporter({
      outputPath: './results/test-results.xml', // default `'./test-results.xml'`
      reportLogs: true, // default `false`
    }),
  ],
};