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

46 lines
1.1 KiB
JavaScript
Raw Normal View History

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