js-waku/packages/core/karma.conf.cjs

46 lines
1.1 KiB
JavaScript
Raw Normal View History

2022-07-26 04:40:40 +00:00
process.env.CHROME_BIN = require("puppeteer").executablePath();
const webpack = require("webpack");
2022-05-20 13:40:56 +00:00
2022-07-26 04:40:40 +00:00
module.exports = function (config) {
2022-05-20 13:40:56 +00:00
config.set({
2022-07-26 04:40:40 +00:00
frameworks: ["webpack", "mocha"],
files: ["src/lib/**/!(node).spec.ts"],
2022-05-20 13:40:56 +00:00
preprocessors: {
"src/lib/**/!(node).spec.ts": ["webpack"]
2022-05-20 13:40:56 +00:00
},
2022-07-26 04:40:40 +00:00
envPreprocessor: ["CI"],
reporters: ["progress"],
browsers: ["ChromeHeadless"],
2022-05-20 13:40:56 +00:00
singleRun: true,
client: {
mocha: {
timeout: 6000 // Default is 2s
}
2022-05-20 13:40:56 +00:00
},
webpack: {
2022-11-03 11:40:42 +00:00
mode: "development",
module: {
rules: [{ test: /\.([cm]?ts|tsx)$/, loader: "ts-loader" }]
},
2022-05-23 04:40:37 +00:00
plugins: [
new webpack.DefinePlugin({
"process.env.CI": process.env.CI || false
2022-05-23 04:40:37 +00:00
}),
new webpack.ProvidePlugin({
process: "process/browser.js"
})
2022-05-23 04:40:37 +00:00
],
resolve: {
2022-11-03 11:40:42 +00:00
extensions: [".ts", ".tsx", ".js"],
extensionAlias: {
".js": [".js", ".ts"],
".cjs": [".cjs", ".cts"],
".mjs": [".mjs", ".mts"]
}
},
2022-07-26 04:40:40 +00:00
stats: { warnings: false },
devtool: "inline-source-map"
}
2022-05-20 13:40:56 +00:00
});
};