Skip to content

Commit

Permalink
R!! Integrates webpack e2e tests from websmith-sandbox project
Browse files Browse the repository at this point in the history
!!! webpack tests are broken due to invalid loader-options from cache
  • Loading branch information
jwloka authored and meck93 committed Feb 12, 2025
1 parent 5bce44b commit 9923b4c
Show file tree
Hide file tree
Showing 18 changed files with 1,241 additions and 320 deletions.
3 changes: 2 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ module.exports = [
["@quatico/websmith-api", __dirname + "/packages/api/src"],
["@quatico/websmith-compiler", __dirname + "/packages/compiler/src"],
["@quatico/websmith-core", __dirname + "/packages/core/src"],
["@quatico/websmith-example-addons", __dirname + "/packages/example-addons/src"],
["@quatico/websmith-node", __dirname + "/packages/node/src"],
["@quatico/websmith-testing", __dirname + "/packages/testing/src"],
["@quatico/websmith-webpack", __dirname + "/packages/webpack/src"],
["@quatico/websmith-runner", __dirname + "/packages/runner/src"],
],
extensions: [".ts", ".js", ".jsx", ".json"],
},
Expand Down
2 changes: 1 addition & 1 deletion packages/node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
Licensed under the MIT License. See LICENSE in the project root for license information.
---------------------------------------------------------------------------------------------
-->
# TypeScript Compiler Runner
# TypeScript Compiler Runner for Node.js

TBD
5 changes: 4 additions & 1 deletion packages/node/src/webpack/WebpackBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ export class WebpackBuild {
if (this.tsLoaderOptions && rule?.loader?.includes("ts-loader")) {
this.injectTsLoaderOptions(rule, this.tsLoaderOptions);
}
if (this.websmithLoaderOptions && rule?.loader?.includes("@quatico/websmith-webpack")) {
if (
this.websmithLoaderOptions &&
(rule?.loader?.includes("@quatico/websmith-webpack") || rule?.loader?.includes("packages/webpack/src/index.ts"))
) {
this.injectWebsmithLoaderOptions(rule, this.websmithLoaderOptions);
}
}
Expand Down
4 changes: 1 addition & 3 deletions packages/webpack-test/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ const config: Config = {
"@quatico/websmith-testing": "<rootDir>/../testing/src",
"@quatico/websmith-webpack": "<rootDir>/../webpack/src",
},
testEnvironment: "node",
testRegex: ".+\\.test\\.ts",
testTimeout: 25000,
testRegex: "tests/.*test\\.(tsx?)$",
};

export default config;
3 changes: 3 additions & 0 deletions packages/webpack-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
"@eslint/compat": "^1.2.5",
"@eslint/js": "^9.19.0",
"@nx/eslint-plugin": "^18.3.4",
"@quatico/websmith-core": "workspace:*",
"@quatico/websmith-node": "workspace:*",
"@quatico/websmith-webpack": "workspace:*",
"@types/jest": "^29.5.14",
"@types/node": "20",
Expand All @@ -41,6 +43,7 @@
"rimraf": "^6.0.1",
"thread-loader": "4.0.4",
"ts-jest": "^29.2.5",
"ts-loader": "^9.5.2",
"typescript": "5.7.3",
"typescript-eslint": "^8.22.0",
"webpack": "^5.97.1",
Expand Down
14 changes: 14 additions & 0 deletions packages/webpack-test/src/foobar-arrow.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* ---------------------------------------------------------------------------------------------
* Copyright (c) Quatico Solutions AG. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
* ---------------------------------------------------------------------------------------------
*/
// @annotated()
export const getFoobar = (date: Date) => {
return foobar(date);
};

const foobar = (date: Date) => {
return `foobar ${date.toISOString()}`;
};
14 changes: 14 additions & 0 deletions packages/webpack-test/src/foobar-function.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* ---------------------------------------------------------------------------------------------
* Copyright (c) Quatico Solutions AG. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
* ---------------------------------------------------------------------------------------------
*/
// @annotated()
export function getFoobar(date: Date) {
return foobar(date);
}

function foobar(date: Date) {
return `foobar ${date.toISOString()}`;
}
181 changes: 0 additions & 181 deletions packages/webpack-test/src/loader.test.ts

This file was deleted.

66 changes: 0 additions & 66 deletions packages/webpack-test/src/webpack-utils.ts

This file was deleted.

Loading

0 comments on commit 9923b4c

Please sign in to comment.