1 const karmaJasmine = require('karma-jasmine');
2 const karmaWebpack = require('karma-webpack');
3 const karmaSpecReporter = require('karma-spec-reporter');
4 const karmaChromeLauncher = require('karma-chrome-launcher');
5 const karmaJunitReporter = require('karma-junit-reporter');
6 const { chromium } = require('playwright');
7 const { existsSync } = require('node:fs');
8 process.env.CHROME_BIN = chromium.executablePath();
10 if (!existsSync(process.env.CHROME_BIN)) {
11 throw new Error('Chromium executable not found. Run `npx playwright install chromium`');
14 module.exports = (config) => {
17 frameworks: ['jasmine', 'webpack'],
18 plugins: [karmaJasmine, karmaWebpack, karmaChromeLauncher, karmaSpecReporter, karmaJunitReporter],
19 files: ['test/index.spec.js'],
21 'test/index.spec.js': ['webpack'],
26 extensions: ['.js', '.ts', '.tsx'],
40 options: { transpileOnly: true },
43 exclude: /node_modules\/(?!.*(bip39|pmcrypto))/,
47 devtool: 'inline-source-map',
50 'text/x-typescript': ['ts', 'tsx'],
52 reporters: ['spec', 'junit'],
54 outputDir: '', // results will be saved as $outputDir/$browserName.xml
55 outputFile: 'test-report.xml', // if included, results will be saved as $outputDir/$browserName/$outputFile
56 suite: '', // suite will become the package name attribute in xml testsuite element
57 useBrowserName: false, // add browser name to report and classes names
60 suppressSkipped: true, // do not print information about skipped tests
64 logLevel: config.LOG_INFO,
68 base: 'ChromeHeadless',
69 flags: ['--no-sandbox'],
72 browsers: ['ChromeHeadlessCI'],
74 concurrency: Infinity,
77 timeoutInterval: 10000,