github.com/GoogleCloudPlatform/testgrid@v0.0.174/web/web-test-runner.config.mjs (about) 1 // import { playwrightLauncher } from '@web/test-runner-playwright'; 2 3 import { fromRollup } from '@web/dev-server-rollup'; 4 import rollupReplace from '@rollup/plugin-replace'; 5 6 const replace = fromRollup(rollupReplace); 7 8 const filteredLogs = ['Running in dev mode', 'lit-html is in dev mode']; 9 10 export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({ 11 /** Test files to run */ 12 files: 'out-tsc/test/**/*.test.js', 13 14 /** Resolve bare module imports */ 15 nodeResolve: { 16 exportConditions: ['browser', 'development'], 17 }, 18 19 /** Filter out lit dev mode logs */ 20 filterBrowserLogs(log) { 21 for (const arg of log.args) { 22 if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) { 23 return false; 24 } 25 } 26 return true; 27 }, 28 29 /** configure test timeout */ 30 testFramework: { 31 config: { 32 ui: 'bdd', 33 timeout: '10000', 34 }, 35 }, 36 37 plugins: [ 38 replace({ 39 'process.env.API_HOST': '"localhost"', 40 'process.env.API_PORT': '3000', 41 }), 42 ], 43 /** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */ 44 // esbuildTarget: 'auto', 45 46 /** Amount of browsers to run concurrently */ 47 // concurrentBrowsers: 2, 48 49 /** Amount of test files per browser to test concurrently */ 50 // concurrency: 1, 51 52 /** Browsers to run tests on */ 53 // browsers: [ 54 // playwrightLauncher({ product: 'chromium' }), 55 // playwrightLauncher({ product: 'firefox' }), 56 // playwrightLauncher({ product: 'webkit' }), 57 // ], 58 59 // See documentation for all available options 60 });