js-waku/karma.conf.cjs

35 lines
889 B
JavaScript
Raw Normal View History

2022-05-20 13:40:56 +00:00
process.env.CHROME_BIN = require("puppeteer").executablePath();
const webpackConfig = require("./webpack.config.cjs");
2022-05-23 04:40:37 +00:00
const webpack = require("webpack");
2022-05-20 13:40:56 +00:00
module.exports = function (config) {
config.set({
frameworks: ["webpack", "mocha"],
files: ["src/lib/**/!(node).spec.ts"],
preprocessors: {
2022-05-23 04:40:37 +00:00
"src/lib/**/!(node).spec.ts": ["webpack"],
2022-05-20 13:40:56 +00:00
},
envPreprocessor: ["CI"],
reporters: ["progress"],
browsers: ["ChromeHeadless"],
singleRun: true,
client: {
mocha: {
timeout: 6000, // Default is 2s
},
},
webpack: {
mode: "production",
module: webpackConfig.module,
2022-05-23 04:40:37 +00:00
plugins: [
new webpack.DefinePlugin({
"process.env.CI": process.env.CI || false,
}),
...webpackConfig.plugins,
],
2022-05-20 13:40:56 +00:00
resolve: webpackConfig.resolve,
stats: { warnings: false },
},
});
};