lion/web-test-runner.config.mjs
2020-10-12 17:05:23 +02:00

38 lines
837 B
JavaScript

import fs from 'fs';
import { playwrightLauncher } from '@web/test-runner-playwright';
const packages = fs
.readdirSync('packages')
.filter(
dir => fs.statSync(`packages/${dir}`).isDirectory() && fs.existsSync(`packages/${dir}/test`),
);
export default {
nodeResolve: true,
coverageConfig: {
report: true,
reportDir: 'coverage',
threshold: {
statements: 90,
branches: 65,
functions: 80,
lines: 90,
},
},
testFramework: {
config: {
timeout: '3000',
},
},
browsers: [
playwrightLauncher({ product: 'firefox', concurrency: 1 }),
playwrightLauncher({ product: 'chromium' }),
playwrightLauncher({ product: 'webkit' }),
],
groups: packages.map(pkg => {
return {
name: pkg,
files: `packages/${pkg}/test/**/*.test.js`,
};
}),
};