fix test runner

This commit is contained in:
Sasha 2024-02-29 23:15:05 +01:00
parent 69266482c8
commit 60036403b3
No known key found for this signature in database
3 changed files with 2120 additions and 1680 deletions

View File

@ -3,7 +3,6 @@ const webpack = require("webpack");
const playwright = require('playwright');
process.env.CHROME_BIN = playwright.chromium.executablePath();
process.env.FIREFOX_BIN = playwright.firefox.executablePath();
const output = {
path: path.join(__dirname, "dist"),
@ -12,13 +11,12 @@ const output = {
module.exports = function (config) {
config.set({
frameworks: ["webpack", "mocha"],
customHeaders: [{
match: '\\.wasm$',
name: 'Content-Type',
value: 'application/wasm'
}],
preprocessors: {
"**/*.ts": ["webpack"],
},
files: [
"src/**/!(node).spec.ts",
"src/**/*.spec.ts",
"src/**/*.ts",
{
pattern: `${output.path}/**/*`,
watched: false,
@ -26,29 +24,36 @@ module.exports = function (config) {
served: true,
},
],
preprocessors: {
"src/**/!(node).spec.ts": ["webpack"]
},
envPreprocessor: ["CI"],
reporters: ["progress"],
browsers: ["ChromeHeadless", "FirefoxHeadless"],
browsers: ["ChromeHeadless"],
pingTimeout: 60000,
singleRun: true,
client: {
mocha: {
timeout: 6000 // Default is 2s
}
timeout: 60000, // Default is 2s
},
},
webpack: {
output,
mode: "production",
module: {
rules: [{
test: /\.wasm$/,
type: "asset/resource",
}, {
test: /\.([cm]?ts|tsx)$/,
loader: "ts-loader"
}]
rules: [
{
test: /\.wasm$/,
type: "asset/resource",
},
{
test: /\.(js|tsx?)$/,
loader: "ts-loader",
exclude: /node_modules|\.d\.ts$/,
options: { configFile: "tsconfig.karma.json" },
},
{
test: /\.d\.ts$/,
loader: "ignore-loader",
},
],
},
plugins: [
new webpack.DefinePlugin({
@ -69,6 +74,6 @@ module.exports = function (config) {
},
stats: { warnings: false },
devtool: "inline-source-map"
}
},
});
};
};

3750
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -107,7 +107,6 @@
"p-timeout": "^4.1.0",
"playwright": "^1.40.1",
"process": "^0.11.10",
"resolve-typescript-plugin": "^1.2.0",
"rollup": "^2.75.0",
"rollup-plugin-copy": "^3.4.0",
"size-limit": "^8.0.0",