@storm-software/testing-tools 1.112.2 → 1.114.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +2 -1
  2. package/dist/index.cjs +126 -8
  3. package/dist/index.d.cts +3 -1
  4. package/dist/index.d.ts +3 -1
  5. package/dist/index.js +113 -7
  6. package/dist/jest/{config/package.cjs → declare-package.cjs} +11 -11
  7. package/dist/jest/declare-package.d.cts +18 -0
  8. package/dist/jest/declare-package.d.ts +18 -0
  9. package/dist/jest/declare-package.js +17 -0
  10. package/dist/jest/declare-preset.cjs +79 -0
  11. package/dist/jest/declare-preset.d.cts +5 -0
  12. package/dist/jest/declare-preset.d.ts +5 -0
  13. package/dist/jest/declare-preset.js +45 -0
  14. package/dist/jest/declare-workspace.cjs +97 -0
  15. package/dist/jest/declare-workspace.d.cts +10 -0
  16. package/dist/jest/declare-workspace.d.ts +10 -0
  17. package/dist/jest/{config/workspace.d.ts → declare-workspace.js} +34 -19
  18. package/dist/jest/{config/preset.cjs → preset/index.cjs} +49 -25
  19. package/dist/jest/preset/index.d.cts +5 -0
  20. package/dist/jest/preset/index.d.ts +5 -0
  21. package/dist/jest/preset/index.js +51 -0
  22. package/dist/jest/preset/jest-preset.cjs +84 -0
  23. package/dist/jest/{config/preset.d.cts → preset/jest-preset.d.cts} +37 -23
  24. package/dist/jest/{config/preset.d.ts → preset/jest-preset.d.ts} +37 -23
  25. package/dist/jest/preset/jest-preset.js +48 -0
  26. package/package.json +52 -23
  27. package/dist/jest/config/package.d.cts +0 -15
  28. package/dist/jest/config/package.d.ts +0 -15
  29. package/dist/jest/config/package.js +0 -17
  30. package/dist/jest/config/preset.js +0 -29
  31. package/dist/jest/config/workspace.cjs +0 -74
  32. package/dist/jest/config/workspace.d.cts +0 -48
  33. package/dist/jest/config/workspace.js +0 -54
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/testing-tools",
3
- "version": "1.112.2",
3
+ "version": "1.114.1",
4
4
  "type": "module",
5
5
  "description": "A package containing various testing tools used by Storm workspaces to drive unit and e2e testing.",
6
6
  "repository": {
@@ -65,46 +65,74 @@
65
65
  "default": "./dist/jest/setup.js"
66
66
  }
67
67
  },
68
- "./jest/config/package": {
68
+ "./jest/declare-package": {
69
69
  "import": {
70
- "types": "./dist/jest/config/package.d.ts",
71
- "default": "./dist/jest/config/package.js"
70
+ "types": "./dist/jest/declare-package.d.ts",
71
+ "default": "./dist/jest/declare-package.js"
72
72
  },
73
73
  "require": {
74
- "types": "./dist/jest/config/package.d.cts",
75
- "default": "./dist/jest/config/package.cjs"
74
+ "types": "./dist/jest/declare-package.d.cts",
75
+ "default": "./dist/jest/declare-package.cjs"
76
76
  },
77
77
  "default": {
78
- "types": "./dist/jest/config/package.d.ts",
79
- "default": "./dist/jest/config/package.js"
78
+ "types": "./dist/jest/declare-package.d.ts",
79
+ "default": "./dist/jest/declare-package.js"
80
80
  }
81
81
  },
82
- "./jest/config/preset": {
82
+ "./jest/declare-workspace": {
83
83
  "import": {
84
- "types": "./dist/jest/config/preset.d.ts",
85
- "default": "./dist/jest/config/preset.js"
84
+ "types": "./dist/jest/declare-workspace.d.ts",
85
+ "default": "./dist/jest/declare-workspace.js"
86
86
  },
87
87
  "require": {
88
- "types": "./dist/jest/config/preset.d.cts",
89
- "default": "./dist/jest/config/preset.cjs"
88
+ "types": "./dist/jest/declare-workspace.d.cts",
89
+ "default": "./dist/jest/declare-workspace.cjs"
90
90
  },
91
91
  "default": {
92
- "types": "./dist/jest/config/preset.d.ts",
93
- "default": "./dist/jest/config/preset.js"
92
+ "types": "./dist/jest/declare-workspace.d.ts",
93
+ "default": "./dist/jest/declare-workspace.js"
94
94
  }
95
95
  },
96
- "./jest/config/workspace": {
96
+ "./jest/declare-preset": {
97
97
  "import": {
98
- "types": "./dist/jest/config/workspace.d.ts",
99
- "default": "./dist/jest/config/workspace.js"
98
+ "types": "./dist/jest/declare-preset.d.ts",
99
+ "default": "./dist/jest/declare-preset.js"
100
100
  },
101
101
  "require": {
102
- "types": "./dist/jest/config/workspace.d.cts",
103
- "default": "./dist/jest/config/workspace.cjs"
102
+ "types": "./dist/jest/declare-preset.d.cts",
103
+ "default": "./dist/jest/declare-preset.cjs"
104
104
  },
105
105
  "default": {
106
- "types": "./dist/jest/config/workspace.d.ts",
107
- "default": "./dist/jest/config/workspace.js"
106
+ "types": "./dist/jest/declare-preset.d.ts",
107
+ "default": "./dist/jest/declare-preset.js"
108
+ }
109
+ },
110
+ "./jest/preset": {
111
+ "import": {
112
+ "types": "./dist/jest/preset/index.d.ts",
113
+ "default": "./dist/jest/preset/index.js"
114
+ },
115
+ "require": {
116
+ "types": "./dist/jest/preset/index.d.cts",
117
+ "default": "./dist/jest/preset/index.cjs"
118
+ },
119
+ "default": {
120
+ "types": "./dist/jest/preset/index.d.ts",
121
+ "default": "./dist/jest/preset/index.js"
122
+ }
123
+ },
124
+ "./jest/preset/jest-preset": {
125
+ "import": {
126
+ "types": "./dist/jest/preset/jest-preset.d.ts",
127
+ "default": "./dist/jest/preset/jest-preset.js"
128
+ },
129
+ "require": {
130
+ "types": "./dist/jest/preset/jest-preset.d.cts",
131
+ "default": "./dist/jest/preset/jest-preset.cjs"
132
+ },
133
+ "default": {
134
+ "types": "./dist/jest/preset/jest-preset.d.ts",
135
+ "default": "./dist/jest/preset/jest-preset.js"
108
136
  }
109
137
  }
110
138
  },
@@ -119,6 +147,7 @@
119
147
  "sullivanpj"
120
148
  ],
121
149
  "peerDependencies": { "@nx/jest": "^21.3.10", "jest": "30.0.5" },
150
+ "dependencies": { "defu": "6.1.4" },
122
151
  "devDependencies": {
123
152
  "@nx/jest": "^21.3.10",
124
153
  "@types/node": "^22.10.2",
@@ -126,5 +155,5 @@
126
155
  "jest-resolve": "30.0.5"
127
156
  },
128
157
  "publishConfig": { "access": "public" },
129
- "gitHead": "43110f104601a8c968a08b471528d712fcf76ffe"
158
+ "gitHead": "e98f9f2645646b8bc1842cb3626e3defb604472f"
130
159
  }
@@ -1,15 +0,0 @@
1
- import { Config } from 'jest';
2
-
3
- /**
4
- * Config for Jest unit tests
5
- *
6
- * @remarks Please see [the Jest documentation](https://jestjs.io/docs/configuration#projects-arraystring--projectconfig) for more information.
7
- *
8
- * @param projectDir The directory of the project
9
- * @param isNode Whether the project is a Node project
10
- * @param displayName The name to display in the Jest output
11
- * @returns The Jest configuration
12
- */
13
- declare function getJestConfig(projectDir: string, isNode?: boolean, displayName?: string): Config;
14
-
15
- export { getJestConfig };
@@ -1,15 +0,0 @@
1
- import { Config } from 'jest';
2
-
3
- /**
4
- * Config for Jest unit tests
5
- *
6
- * @remarks Please see [the Jest documentation](https://jestjs.io/docs/configuration#projects-arraystring--projectconfig) for more information.
7
- *
8
- * @param projectDir The directory of the project
9
- * @param isNode Whether the project is a Node project
10
- * @param displayName The name to display in the Jest output
11
- * @returns The Jest configuration
12
- */
13
- declare function getJestConfig(projectDir: string, isNode?: boolean, displayName?: string): Config;
14
-
15
- export { getJestConfig };
@@ -1,17 +0,0 @@
1
- // src/jest/config/package.ts
2
- import { join } from "node:path";
3
- function getJestConfig(projectDir, isNode = true, displayName) {
4
- return {
5
- displayName: displayName ? displayName : projectDir.replaceAll("\\", "-").replaceAll("/", "-"),
6
- preset: "@storm-software/testing-tools/jest/config/preset",
7
- testEnvironment: isNode ? "node" : "jsdom",
8
- transform: {
9
- "^.+\\.[tj]s$": ["ts-jest", { tsconfig: "<rootDir>/tsconfig.spec.json" }]
10
- },
11
- moduleFileExtensions: ["ts", "js", "html"],
12
- coverageDirectory: join("../../coverage", projectDir)
13
- };
14
- }
15
- export {
16
- getJestConfig
17
- };
@@ -1,29 +0,0 @@
1
- // src/jest/config/preset.ts
2
- import nxPreset from "@nx/jest/preset";
3
- var preset_default = {
4
- ...nxPreset,
5
- collectCoverage: true,
6
- testTimeout: 3e4,
7
- clearMocks: true,
8
- testMatch: ["**/+(*.)+(spec|test).+(ts|js)?(x)"],
9
- transform: {
10
- "^.+\\.(ts|js|html)$": "ts-jest"
11
- },
12
- snapshotFormat: {
13
- printBasicPrototype: false
14
- },
15
- globals: {
16
- "ts-jest": {
17
- isolatedModules: true,
18
- diagnostics: {
19
- exclude: ["**"]
20
- }
21
- }
22
- },
23
- moduleFileExtensions: ["ts", "js", "html"],
24
- coverageReporters: ["json", "lcov", "text", "clover", "text-summary", "html"],
25
- maxWorkers: 1
26
- };
27
- export {
28
- preset_default as default
29
- };
@@ -1,74 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/jest/config/workspace.ts
20
- var workspace_exports = {};
21
- __export(workspace_exports, {
22
- default: () => workspace_default
23
- });
24
- module.exports = __toCommonJS(workspace_exports);
25
- var import_jest = require("@nx/jest");
26
- var workspace_default = async () => ({
27
- /**
28
- * When the projects configuration is provided with an array of paths or glob patterns, Jest will run tests in all of the specified projects at the same time.
29
- * This is great for monorepos or when working on multiple projects at the same time.
30
- */
31
- projects: [...await (0, import_jest.getJestProjectsAsync)(), "<rootDir>/jest.config.ts"],
32
- /**
33
- * Indicates whether the coverage information should be collected while executing the test. Because this retrofits all
34
- * executed files with coverage collection statements, it may significantly slow down your tests. Default: false
35
- */
36
- collectCoverage: process.env.CI ? true : false,
37
- /**
38
- * An array of glob patterns indicating a set of files for which coverage information should be collected.
39
- * If a file matches the specified glob pattern, coverage information will be collected for it even if no tests exist
40
- * for this file and it's never required in the test suite. Default: undefined
41
- */
42
- // collectCoverageFrom: ["**/*(!*.spec).tsx", "**/*(!*.spec).ts"],
43
- /**
44
- * The directory where Jest should output its coverage files. Default: undefined
45
- */
46
- coverageDirectory: "<rootDir>/coverage",
47
- /**
48
- * An array of regexp pattern strings that are matched against all file paths before executing the test. If the file path
49
- * matches any of the patterns, coverage information will be skipped.
50
- */
51
- coveragePathIgnorePatterns: [
52
- "\\.spec\\.ts$",
53
- "\\.test\\.ts$",
54
- "<rootDir>/dist",
55
- "<rootDir>/tests",
56
- "<rootDir>/__generated__",
57
- "<rootDir>/node_modules"
58
- ],
59
- /**
60
- * The test environment that will be used for testing. The default environment in Jest is a Node.js environment.
61
- * If you are building a web app, you can use a browser-like environment through jsdom instead.
62
- */
63
- testEnvironment: "jest-environment-jsdom",
64
- /**
65
- * A list of reporter names that Jest uses when writing coverage reports. Any istanbul reporter can be used.
66
- * Default: ["json", "lcov", "text"]
67
- */
68
- coverageReporters: ["lcov", "json"],
69
- setupFiles: ["./node_modules/@storm-software/testing-tools/jest/setup"],
70
- moduleNameMapper: {
71
- "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "@storm-software/testing-tools/jest/__mocks__/file.mock.js",
72
- "\\.(css|less)$": "@storm-software/testing-tools/jest/__mocks__/style.mock.js"
73
- }
74
- });
@@ -1,48 +0,0 @@
1
- /**
2
- * Config for Jest unit tests
3
- *
4
- * https://jestjs.io/docs/configuration#projects-arraystring--projectconfig
5
- */
6
- declare const _default: () => Promise<{
7
- /**
8
- * When the projects configuration is provided with an array of paths or glob patterns, Jest will run tests in all of the specified projects at the same time.
9
- * This is great for monorepos or when working on multiple projects at the same time.
10
- */
11
- projects: string[];
12
- /**
13
- * Indicates whether the coverage information should be collected while executing the test. Because this retrofits all
14
- * executed files with coverage collection statements, it may significantly slow down your tests. Default: false
15
- */
16
- collectCoverage: boolean;
17
- /**
18
- * An array of glob patterns indicating a set of files for which coverage information should be collected.
19
- * If a file matches the specified glob pattern, coverage information will be collected for it even if no tests exist
20
- * for this file and it's never required in the test suite. Default: undefined
21
- */
22
- /**
23
- * The directory where Jest should output its coverage files. Default: undefined
24
- */
25
- coverageDirectory: string;
26
- /**
27
- * An array of regexp pattern strings that are matched against all file paths before executing the test. If the file path
28
- * matches any of the patterns, coverage information will be skipped.
29
- */
30
- coveragePathIgnorePatterns: string[];
31
- /**
32
- * The test environment that will be used for testing. The default environment in Jest is a Node.js environment.
33
- * If you are building a web app, you can use a browser-like environment through jsdom instead.
34
- */
35
- testEnvironment: string;
36
- /**
37
- * A list of reporter names that Jest uses when writing coverage reports. Any istanbul reporter can be used.
38
- * Default: ["json", "lcov", "text"]
39
- */
40
- coverageReporters: string[];
41
- setupFiles: string[];
42
- moduleNameMapper: {
43
- "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": string;
44
- "\\.(css|less)$": string;
45
- };
46
- }>;
47
-
48
- export { _default as default };
@@ -1,54 +0,0 @@
1
- // src/jest/config/workspace.ts
2
- import { getJestProjectsAsync } from "@nx/jest";
3
- var workspace_default = async () => ({
4
- /**
5
- * When the projects configuration is provided with an array of paths or glob patterns, Jest will run tests in all of the specified projects at the same time.
6
- * This is great for monorepos or when working on multiple projects at the same time.
7
- */
8
- projects: [...await getJestProjectsAsync(), "<rootDir>/jest.config.ts"],
9
- /**
10
- * Indicates whether the coverage information should be collected while executing the test. Because this retrofits all
11
- * executed files with coverage collection statements, it may significantly slow down your tests. Default: false
12
- */
13
- collectCoverage: process.env.CI ? true : false,
14
- /**
15
- * An array of glob patterns indicating a set of files for which coverage information should be collected.
16
- * If a file matches the specified glob pattern, coverage information will be collected for it even if no tests exist
17
- * for this file and it's never required in the test suite. Default: undefined
18
- */
19
- // collectCoverageFrom: ["**/*(!*.spec).tsx", "**/*(!*.spec).ts"],
20
- /**
21
- * The directory where Jest should output its coverage files. Default: undefined
22
- */
23
- coverageDirectory: "<rootDir>/coverage",
24
- /**
25
- * An array of regexp pattern strings that are matched against all file paths before executing the test. If the file path
26
- * matches any of the patterns, coverage information will be skipped.
27
- */
28
- coveragePathIgnorePatterns: [
29
- "\\.spec\\.ts$",
30
- "\\.test\\.ts$",
31
- "<rootDir>/dist",
32
- "<rootDir>/tests",
33
- "<rootDir>/__generated__",
34
- "<rootDir>/node_modules"
35
- ],
36
- /**
37
- * The test environment that will be used for testing. The default environment in Jest is a Node.js environment.
38
- * If you are building a web app, you can use a browser-like environment through jsdom instead.
39
- */
40
- testEnvironment: "jest-environment-jsdom",
41
- /**
42
- * A list of reporter names that Jest uses when writing coverage reports. Any istanbul reporter can be used.
43
- * Default: ["json", "lcov", "text"]
44
- */
45
- coverageReporters: ["lcov", "json"],
46
- setupFiles: ["./node_modules/@storm-software/testing-tools/jest/setup"],
47
- moduleNameMapper: {
48
- "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "@storm-software/testing-tools/jest/__mocks__/file.mock.js",
49
- "\\.(css|less)$": "@storm-software/testing-tools/jest/__mocks__/style.mock.js"
50
- }
51
- });
52
- export {
53
- workspace_default as default
54
- };