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: {
|
2023-08-16 14:48:13 +00:00
|
|
|
"src/**/*.ts": ["webpack"]
|
2022-11-02 11:25:47 +00:00
|
|
|
},
|
|
|
|
envPreprocessor: ["CI"],
|
|
|
|
reporters: ["progress"],
|
|
|
|
browsers: ["ChromeHeadless"],
|
|
|
|
singleRun: true,
|
|
|
|
client: {
|
|
|
|
mocha: {
|
2023-08-16 14:48:13 +00:00
|
|
|
timeout: 6000 // Default is 2s
|
|
|
|
}
|
2022-11-02 11:25:47 +00:00
|
|
|
},
|
|
|
|
webpack: {
|
|
|
|
mode: "development",
|
|
|
|
module: {
|
2023-08-16 14:48:13 +00:00
|
|
|
rules: [{ test: /\.([cm]?ts|tsx)$/, loader: "ts-loader" }]
|
2022-11-02 11:25:47 +00:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new webpack.DefinePlugin({
|
2023-08-16 14:48:13 +00:00
|
|
|
"process.env.CI": process.env.CI || false
|
2022-11-02 11:25:47 +00:00
|
|
|
}),
|
|
|
|
new webpack.ProvidePlugin({
|
2023-08-16 14:48:13 +00:00
|
|
|
process: "process/browser.js"
|
|
|
|
})
|
2022-11-02 11:25:47 +00:00
|
|
|
],
|
|
|
|
resolve: {
|
|
|
|
extensions: [".ts", ".tsx", ".js"],
|
|
|
|
extensionAlias: {
|
|
|
|
".js": [".js", ".ts"],
|
|
|
|
".cjs": [".cjs", ".cts"],
|
2023-08-16 14:48:13 +00:00
|
|
|
".mjs": [".mjs", ".mts"]
|
|
|
|
}
|
2022-11-02 11:25:47 +00:00
|
|
|
},
|
|
|
|
stats: { warnings: false },
|
2023-08-16 14:48:13 +00:00
|
|
|
devtool: "inline-source-map"
|
|
|
|
}
|
2022-11-02 11:25:47 +00:00
|
|
|
});
|
|
|
|
};
|