Fix Jest WASM tests
This commit is contained in:
parent
438caa96a6
commit
7e045caab1
4 changed files with 110 additions and 109 deletions
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"jest.jestCommandLine": "npx jest",
|
"jest.jestCommandLine": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" npx jest",
|
||||||
"jest.rootPath": "plugin"
|
"jest.rootPath": "plugin"
|
||||||
}
|
}
|
||||||
|
|
@ -1,8 +1,3 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
testEnvironment: "node",
|
preset: "ts-jest/presets/js-with-babel-esm"
|
||||||
moduleFileExtensions: ["js", "ts"],
|
|
||||||
testMatch: ["**/src/**/*.test.ts"],
|
|
||||||
transform: {
|
|
||||||
"^.+\\.(ts|tsx)$": "ts-jest",
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -6,13 +6,12 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "webpack watch --mode development",
|
"dev": "webpack watch --mode development",
|
||||||
"build": "webpack --mode production",
|
"build": "webpack --mode production",
|
||||||
"test": "jest",
|
"test": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest",
|
||||||
"lint": "eslint --fix src && prettier --write \"src/**/*.(ts|scss|json|html)\"",
|
"lint": "eslint --fix src && prettier --write \"src/**/*.(ts|scss|json|html)\"",
|
||||||
"version": "node version-bump.mjs"
|
"version": "node version-bump.mjs"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "",
|
||||||
"type": "commonjs",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"prettier": {
|
"prettier": {
|
||||||
"trailingComma": "none",
|
"trailingComma": "none",
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ module.exports = (env, argv) => ({
|
||||||
new MiniCssExtractPlugin({
|
new MiniCssExtractPlugin({
|
||||||
filename: "styles.css"
|
filename: "styles.css"
|
||||||
}),
|
}),
|
||||||
|
|
||||||
new (require("webpack").DefinePlugin)({
|
new (require("webpack").DefinePlugin)({
|
||||||
__CURRENT_DATE__: Date.now()
|
__CURRENT_DATE__: Date.now()
|
||||||
}),
|
}),
|
||||||
|
|
@ -45,8 +46,14 @@ module.exports = (env, argv) => ({
|
||||||
];
|
];
|
||||||
destinations.forEach((destination) => {
|
destinations.forEach((destination) => {
|
||||||
fs.copy(source, destination)
|
fs.copy(source, destination)
|
||||||
.then(() => console.log("Files copied successfully after build!"))
|
.then(() =>
|
||||||
.catch((err) => console.error("Error copying files:", err));
|
console.log(
|
||||||
|
"Files copied successfully after build!"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.catch((err) =>
|
||||||
|
console.error("Error copying files:", err)
|
||||||
|
);
|
||||||
|
|
||||||
fs.createFile(path.join(destination, ".hotreload"));
|
fs.createFile(path.join(destination, ".hotreload"));
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue