Skip to content

Commit

Permalink
Merge pull request #43 from quatico-solutions/websmith-addon-testing-api
Browse files Browse the repository at this point in the history
Websmith addon testing api
  • Loading branch information
jwloka authored May 9, 2024
2 parents 80a1a5a + 4d7da05 commit fa0db82
Show file tree
Hide file tree
Showing 97 changed files with 3,593 additions and 2,365 deletions.
3 changes: 2 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
registry=https://registry.npmjs.org
registry=https://registry.npmjs.org
node-linker=hoisted
13 changes: 3 additions & 10 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,7 @@
"name": "vscode-jest-tests",
"request": "launch",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [
"--runInBand",
"--watchAll=false",
"--testNamePattern",
"${jest.testNamePattern}",
"--runTestsByPath",
"${jest.testFile}"
],
"args": ["--runInBand", "--watchAll=false", "--testNamePattern", "${jest.testNamePattern}", "--runTestsByPath", "${jest.testFile}"],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
Expand All @@ -32,8 +25,8 @@
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"cwd": "${workspaceFolder}/packages/webpack",
"args": ["-c", "${workspaceFolder}/packages/webpack/jest.e2e.config.js", "--runInBand", "-o", "--all"],
"cwd": "${workspaceFolder}/packages/webpack-test",
"args": ["-c", "${workspaceFolder}/packages/webpack-test/jest.config.js", "--runInBand", "-o", "--all"],
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
}
Expand Down
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@
"search.exclude": {
"pnpm-lock.yaml": true
},
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"eslint.useESLintClass": true,
"eslint.problems.shortenToSingleLine": true,
"eslint.quiet": true
}
4 changes: 1 addition & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ module.exports = {
"@quatico/websmith-webpack": "<rootDir>/packages/webpack/src",
},
prettierPath: null,
modulePathIgnorePatterns: ["<rootDir>/packages/compiler/test/__mocks__/fs.ts"],
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
testRegex: "src/.*spec\\.(tsx?)$",
testEnvironmentOptions: { url: "http://localhost/" },
transform: {
"^.+\\.(js|ts)$": [
"@swc/jest",
Expand All @@ -35,5 +33,5 @@ module.exports = {
},
transformIgnorePatterns: ["node_modules"],
resetMocks: true,
watchman: false,
clearMocks: true,
};
10 changes: 0 additions & 10 deletions jest.setup.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
/* eslint-disable no-console */
import { tsLibMocks } from "./packages/testing/src/tsLibMocks";
import { readE2eTestData } from "./packages/test/src/test-data-helper";

tsLibMocks();

console.info = () => undefined;
console.log = () => undefined;

afterEach(() => {
jest.clearAllMocks();
});

export { readE2eTestData };
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
"@cucumber/gherkin": "^28.0.0",
"@eslint/js": "^9.1.1",
"@nrwl/nx-cloud": "18.0.1",
"@nx/eslint-plugin": "^18.3.3",
"@nx/eslint-plugin": "^18.3.4",
"@swc/core": "1.5.0",
"@swc/jest": "0.2.36",
"@types/glob": "^8.1.0",
"@types/jest": "^29.5.12",
"@types/node": "^20.12.7",
"@types/node": "20",
"commander": "^12.0.0",
"concurrently": "^8.2.2",
"create-hash": "1.2.0",
Expand All @@ -54,15 +54,15 @@
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^28.2.0",
"eslint-plugin-jest": "^28.3.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-testing-library": "^6.2.2",
"globals": "^15.0.0",
"globals": "^15.1.0",
"husky": "9.0.11",
"jest": "^29.7.0",
"license-check-and-add": "4.0.5",
"memfs": "^4.8.2",
"nx": "^18.3.3",
"memfs": "^4.9.2",
"nx": "^18.3.4",
"path": "0.12.7",
"prettier": "^3.2.5",
"quill-delta": "^5.1.0",
Expand All @@ -71,7 +71,7 @@
"ts-node": "^10.9.2",
"tslib": "2.6.2",
"typescript": "5.4.5",
"typescript-eslint": "^7.7.1",
"typescript-eslint": "^7.8.0",
"webpack": "^5.91.0"
},
"pnpm": {
Expand Down
2 changes: 1 addition & 1 deletion packages/api/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ module.exports = {
coverageDirectory: "coverage",
coveragePathIgnorePatterns: ["index.ts"],
moduleFileExtensions: ["ts", "js", "json", "node"],
prettierPath: null,
testRegex: "src/.*spec\\.(js|ts)$",
setupFilesAfterEnv: ["<rootDir>/../../jest.setup.ts"],
testEnvironmentOptions: { url: "http://localhost/" },
transform: {
"^.+\\.(js|ts)$": [
"@swc/jest",
Expand Down
8 changes: 4 additions & 4 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"devDependencies": {
"@eslint/js": "^9.1.1",
"@nx/eslint-plugin": "^18.3.3",
"@nx/eslint-plugin": "^18.3.4",
"@swc/core": "1.5.0",
"@swc/jest": "0.2.36",
"@types/jest": "^29.5.12",
Expand All @@ -43,15 +43,15 @@
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^28.2.0",
"eslint-plugin-jest": "^28.3.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-testing-library": "^6.2.2",
"globals": "^15.0.0",
"globals": "^15.1.0",
"jest": "^29.7.0",
"prettier": "^3.2.5",
"rimraf": "5.0.5",
"typescript": "5.4.5",
"typescript-eslint": "^7.7.1"
"typescript-eslint": "^7.8.0"
},
"peerDependencies": {
"typescript": "5.x"
Expand Down
25 changes: 11 additions & 14 deletions packages/api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@
* Licensed under the MIT License. See LICENSE in the project root for license information.
* ---------------------------------------------------------------------------------------------
*/
import type { AddonActivator } from "./AddonActivator";
import type { AddonContext } from "./AddonContext";
import { ErrorMessage } from "./ErrorMessage";
import type { Generator } from "./Generator";
import { InfoMessage } from "./InfoMessage";
import { aggregateMessages, messageToString } from "./messages";
import type { Processor } from "./Processor";
import type { Reporter } from "./Reporter";
import type { ResultProcessor } from "./ResultProcessor";
import type { TargetConfig } from "./TargetConfig";
import { WarnMessage } from "./WarnMessage";

export type { AddonActivator, AddonContext, Generator, TargetConfig, ResultProcessor, Processor, Reporter };
export { ErrorMessage, WarnMessage, InfoMessage, aggregateMessages, messageToString };
export type { AddonActivator } from "./AddonActivator";
export type { AddonContext } from "./AddonContext";
export { ErrorMessage } from "./ErrorMessage";
export type { Generator } from "./Generator";
export { InfoMessage } from "./InfoMessage";
export { aggregateMessages, messageToString } from "./messages";
export type { Processor } from "./Processor";
export type { Reporter } from "./Reporter";
export type { ResultProcessor } from "./ResultProcessor";
export type { TargetConfig } from "./TargetConfig";
export { WarnMessage } from "./WarnMessage";
1 change: 0 additions & 1 deletion packages/compiler/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module.exports = {
prettierPath: null,
testRegex: "src/.*\\.spec\\.(j|t)s$",
setupFilesAfterEnv: ["<rootDir>/../../jest.setup.ts"],
testEnvironmentOptions: { url: "http://localhost/" },
transform: {
"^.+\\.(js|ts)$": [
"@swc/jest",
Expand Down
16 changes: 8 additions & 8 deletions packages/compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,31 @@
},
"devDependencies": {
"@eslint/js": "^9.1.1",
"@nx/eslint-plugin": "^18.3.3",
"@quatico/websmith-testing": "workspace:^",
"@nx/eslint-plugin": "^18.3.4",
"@quatico/websmith-testing": "workspace:*",
"@swc/core": "1.5.0",
"@swc/jest": "0.2.36",
"@types/jest": "^29.5.12",
"@types/minimist": "^1.2.5",
"@types/node": "^20.12.7",
"@types/node": "20",
"concurrently": "^8.2.2",
"cross-env": "7.0.3",
"eslint": "^9.1.1",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^28.2.0",
"eslint-plugin-jest": "^28.3.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-testing-library": "^6.2.2",
"globals": "^15.0.0",
"globals": "^15.1.0",
"jest": "^29.7.0",
"prettier": "^3.2.5",
"rimraf": "5.0.5",
"typescript-eslint": "^7.7.1"
"typescript-eslint": "^7.8.0"
},
"dependencies": {
"@quatico/websmith-api": "workspace:^",
"@quatico/websmith-core": "workspace:^",
"@quatico/websmith-api": "workspace:*",
"@quatico/websmith-core": "workspace:*",
"commander": "^12.0.0",
"minimist": "^1.2.8",
"ts-node": "^10.9.2",
Expand Down
2 changes: 0 additions & 2 deletions packages/compiler/src/CompilerArguments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* ---------------------------------------------------------------------------------------------
*/
export interface CompilerArguments {
addons?: string;
addonsDir?: string;
buildDir?: string;
config?: string;
debug?: boolean;
Expand Down
Loading

0 comments on commit fa0db82

Please sign in to comment.