The project uses @web/test-runner for testing. Configuration is defined in a web-test-runner.config.mjs file by exporting a TestRunnerConfig object.
Key configuration options include:
files: An array of paths to the test files to be executed.plugins: An array of plugins to extend the runner's functionality (e.g., using rollupBundlePlugin to handle dependency bundling).reporters: An array of reporter objects to control how test results are displayed (e.g., defaultReporter and summaryReporter).coverage: A boolean to enable or disable code coverage analysis.manual: A boolean that, when true, allows running tests manually in a browser for debugging.nodeResolve: Configuration for resolving bare module imports, including exportConditions.rootDir: The root directory for the test runner.filterBrowserLogs: A function used to filter out specific logs from the browser output.concurrency: The number of test files to run concurrently per browser.concurrentBrowsers: (Commented out in source) The number of browsers to run concurrently.
export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
files: ['test/runner/spec.test.js', 'test/runner/complex.test.js'],
plugins: [
rollupBundlePlugin({
rollupConfig: {
input: 'out-tsc/index.js',
plugins: [nodeResolve(), commonjs()]
}
})
],
reporters: [
defaultReporter({ reportTestResults: false, reportTestProgress: true }),
summaryReporter()
],
coverage: false,
manual: false,
nodeResolve: {
exportConditions: ['browser', 'development']
},
rootDir: './',
concurrency: 1
})