@storm-software/testing-tools 1.111.17 → 1.112.0

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.
@@ -1,24 +1,34 @@
1
- // packages/testing-tools/src/jest/package.config.ts
2
- import { join } from "node:path";
3
- var getJestConfig = (projectDir, isNode = true, displayName) => ({
4
- displayName: displayName ? displayName : projectDir.replaceAll("\\", "-").replaceAll("/", "-"),
5
- preset: "@storm-software/testing-tools/jest/preset.js",
6
- testEnvironment: isNode ? "node" : "jsdom",
7
- transform: {
8
- "^.+\\.[tj]s$": ["ts-jest", { tsconfig: "<rootDir>/tsconfig.spec.json" }]
9
- },
10
- moduleFileExtensions: ["ts", "js", "html"],
11
- coverageDirectory: join("../../coverage", projectDir)
12
- });
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);
13
18
 
14
- // packages/testing-tools/src/jest/workspace.config.ts
15
- import { getJestProjectsAsync } from "@nx/jest";
16
- var workspace_config_default = {
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 () => ({
17
27
  /**
18
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.
19
29
  * This is great for monorepos or when working on multiple projects at the same time.
20
30
  */
21
- projects: await getJestProjectsAsync(),
31
+ projects: [...await (0, import_jest.getJestProjectsAsync)(), "<rootDir>/jest.config.ts"],
22
32
  /**
23
33
  * Indicates whether the coverage information should be collected while executing the test. Because this retrofits all
24
34
  * executed files with coverage collection statements, it may significantly slow down your tests. Default: false
@@ -56,12 +66,9 @@ var workspace_config_default = {
56
66
  * Default: ["json", "lcov", "text"]
57
67
  */
58
68
  coverageReporters: ["lcov", "json"],
59
- setupFiles: ["@storm-software/testing-tools/jest/__mocks__/jest.setup.js"],
69
+ setupFiles: ["@storm-software/testing-tools/jest/setup"],
60
70
  moduleNameMapper: {
61
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",
62
72
  "\\.(css|less)$": "@storm-software/testing-tools/jest/__mocks__/style.mock.js"
63
73
  }
64
- };
65
- export {
66
- getJestConfig
67
- };
74
+ });
@@ -0,0 +1,48 @@
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 };
@@ -0,0 +1,48 @@
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,35 +1,26 @@
1
+ // src/jest/config/workspace.ts
1
2
  import { getJestProjectsAsync } from "@nx/jest";
2
-
3
- /**
4
- * Config for Jest unit tests
5
- *
6
- * https://jestjs.io/docs/configuration#projects-arraystring--projectconfig
7
- */
8
- export default {
3
+ var workspace_default = async () => ({
9
4
  /**
10
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.
11
6
  * This is great for monorepos or when working on multiple projects at the same time.
12
7
  */
13
- projects: await getJestProjectsAsync(),
14
-
8
+ projects: [...await getJestProjectsAsync(), "<rootDir>/jest.config.ts"],
15
9
  /**
16
10
  * Indicates whether the coverage information should be collected while executing the test. Because this retrofits all
17
11
  * executed files with coverage collection statements, it may significantly slow down your tests. Default: false
18
12
  */
19
13
  collectCoverage: process.env.CI ? true : false,
20
-
21
14
  /**
22
15
  * An array of glob patterns indicating a set of files for which coverage information should be collected.
23
16
  * If a file matches the specified glob pattern, coverage information will be collected for it even if no tests exist
24
17
  * for this file and it's never required in the test suite. Default: undefined
25
18
  */
26
19
  // collectCoverageFrom: ["**/*(!*.spec).tsx", "**/*(!*.spec).ts"],
27
-
28
20
  /**
29
21
  * The directory where Jest should output its coverage files. Default: undefined
30
22
  */
31
23
  coverageDirectory: "<rootDir>/coverage",
32
-
33
24
  /**
34
25
  * An array of regexp pattern strings that are matched against all file paths before executing the test. If the file path
35
26
  * matches any of the patterns, coverage information will be skipped.
@@ -42,25 +33,22 @@ export default {
42
33
  "<rootDir>/__generated__",
43
34
  "<rootDir>/node_modules"
44
35
  ],
45
-
46
36
  /**
47
37
  * The test environment that will be used for testing. The default environment in Jest is a Node.js environment.
48
38
  * If you are building a web app, you can use a browser-like environment through jsdom instead.
49
39
  */
50
40
  testEnvironment: "jest-environment-jsdom",
51
-
52
41
  /**
53
42
  * A list of reporter names that Jest uses when writing coverage reports. Any istanbul reporter can be used.
54
43
  * Default: ["json", "lcov", "text"]
55
44
  */
56
45
  coverageReporters: ["lcov", "json"],
57
-
58
- setupFiles: ["@storm-software/testing-tools/jest/__mocks__/jest.setup.js"],
59
-
46
+ setupFiles: ["@storm-software/testing-tools/jest/setup"],
60
47
  moduleNameMapper: {
61
- "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
62
- "@storm-software/testing-tools/jest/__mocks__/file.mock.js",
63
- "\\.(css|less)$":
64
- "@storm-software/testing-tools/jest/__mocks__/style.mock.js"
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"
65
50
  }
51
+ });
52
+ export {
53
+ workspace_default as default
66
54
  };
@@ -0,0 +1,33 @@
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/file-transformer.ts
20
+ var file_transformer_exports = {};
21
+ __export(file_transformer_exports, {
22
+ default: () => file_transformer_default
23
+ });
24
+ module.exports = __toCommonJS(file_transformer_exports);
25
+ var import_node_path = require("path");
26
+ var file_transformer_default = {
27
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
28
+ process(_sourceText, sourcePath, _options) {
29
+ return {
30
+ code: `module.exports = ${JSON.stringify((0, import_node_path.basename)(sourcePath))};`
31
+ };
32
+ }
33
+ };
@@ -0,0 +1,7 @@
1
+ declare const _default: {
2
+ process(_sourceText: any, sourcePath: string, _options: any): {
3
+ code: string;
4
+ };
5
+ };
6
+
7
+ export { _default as default };
@@ -0,0 +1,7 @@
1
+ declare const _default: {
2
+ process(_sourceText: any, sourcePath: string, _options: any): {
3
+ code: string;
4
+ };
5
+ };
6
+
7
+ export { _default as default };
@@ -0,0 +1,13 @@
1
+ // src/jest/file-transformer.ts
2
+ import { basename } from "node:path";
3
+ var file_transformer_default = {
4
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
5
+ process(_sourceText, sourcePath, _options) {
6
+ return {
7
+ code: `module.exports = ${JSON.stringify(basename(sourcePath))};`
8
+ };
9
+ }
10
+ };
11
+ export {
12
+ file_transformer_default as default
13
+ };
@@ -0,0 +1,3 @@
1
+ // src/jest/setup.ts
2
+ var import_node_util = require("util");
3
+ Object.assign(global, { TextDecoder: import_node_util.TextDecoder, TextEncoder: import_node_util.TextEncoder });
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,3 @@
1
+ // src/jest/setup.ts
2
+ import { TextDecoder, TextEncoder } from "node:util";
3
+ Object.assign(global, { TextDecoder, TextEncoder });
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@storm-software/testing-tools",
3
- "version": "1.111.17",
4
- "type": "commonjs",
5
- "description": "A package containing various testing tools used by Storm workspaces to drive unit and e2e testing.",
3
+ "version": "1.112.0",
4
+ "type": "module",
5
+ "description": "A package containing various testing tools used by Storm workspaces to drive unit and e2e testing.",
6
6
  "repository": {
7
7
  "type": "github",
8
8
  "url": "https://github.com/storm-software/storm-ops",
@@ -17,8 +17,99 @@
17
17
  },
18
18
  "license": "Apache-2.0",
19
19
  "private": false,
20
- "module": "./index.js",
21
- "types": "./declarations.d.ts",
20
+ "main": "./dist/index.cjs",
21
+ "module": "./dist/index.js",
22
+ "exports": {
23
+ "./jest/__mocks__/*.js": "./jest/__mocks__/*.js",
24
+ ".": {
25
+ "import": { "types": "./dist/index.d.ts", "default": "./dist/index.js" },
26
+ "require": {
27
+ "types": "./dist/index.d.cts",
28
+ "default": "./dist/index.cjs"
29
+ },
30
+ "default": { "types": "./dist/index.d.ts", "default": "./dist/index.cjs" }
31
+ },
32
+ "./index": {
33
+ "import": { "types": "./dist/index.d.ts", "default": "./dist/index.js" },
34
+ "require": {
35
+ "types": "./dist/index.d.cts",
36
+ "default": "./dist/index.cjs"
37
+ },
38
+ "default": { "types": "./dist/index.d.ts", "default": "./dist/index.js" }
39
+ },
40
+ "./jest/file-transformer": {
41
+ "import": {
42
+ "types": "./dist/jest/file-transformer.d.ts",
43
+ "default": "./dist/jest/file-transformer.js"
44
+ },
45
+ "require": {
46
+ "types": "./dist/jest/file-transformer.d.cts",
47
+ "default": "./dist/jest/file-transformer.cjs"
48
+ },
49
+ "default": {
50
+ "types": "./dist/jest/file-transformer.d.ts",
51
+ "default": "./dist/jest/file-transformer.js"
52
+ }
53
+ },
54
+ "./jest/setup": {
55
+ "import": {
56
+ "types": "./dist/jest/setup.d.ts",
57
+ "default": "./dist/jest/setup.js"
58
+ },
59
+ "require": {
60
+ "types": "./dist/jest/setup.d.cts",
61
+ "default": "./dist/jest/setup.cjs"
62
+ },
63
+ "default": {
64
+ "types": "./dist/jest/setup.d.ts",
65
+ "default": "./dist/jest/setup.js"
66
+ }
67
+ },
68
+ "./jest/config/package": {
69
+ "import": {
70
+ "types": "./dist/jest/config/package.d.ts",
71
+ "default": "./dist/jest/config/package.js"
72
+ },
73
+ "require": {
74
+ "types": "./dist/jest/config/package.d.cts",
75
+ "default": "./dist/jest/config/package.cjs"
76
+ },
77
+ "default": {
78
+ "types": "./dist/jest/config/package.d.ts",
79
+ "default": "./dist/jest/config/package.js"
80
+ }
81
+ },
82
+ "./jest/config/preset": {
83
+ "import": {
84
+ "types": "./dist/jest/config/preset.d.ts",
85
+ "default": "./dist/jest/config/preset.js"
86
+ },
87
+ "require": {
88
+ "types": "./dist/jest/config/preset.d.cts",
89
+ "default": "./dist/jest/config/preset.cjs"
90
+ },
91
+ "default": {
92
+ "types": "./dist/jest/config/preset.d.ts",
93
+ "default": "./dist/jest/config/preset.js"
94
+ }
95
+ },
96
+ "./jest/config/workspace": {
97
+ "import": {
98
+ "types": "./dist/jest/config/workspace.d.ts",
99
+ "default": "./dist/jest/config/workspace.js"
100
+ },
101
+ "require": {
102
+ "types": "./dist/jest/config/workspace.d.cts",
103
+ "default": "./dist/jest/config/workspace.cjs"
104
+ },
105
+ "default": {
106
+ "types": "./dist/jest/config/workspace.d.ts",
107
+ "default": "./dist/jest/config/workspace.js"
108
+ }
109
+ }
110
+ },
111
+ "types": "./dist/index.d.ts",
112
+ "files": ["dist/**/*"],
22
113
  "keywords": [
23
114
  "monorepo",
24
115
  "jest",
@@ -35,5 +126,5 @@
35
126
  "jest-resolve": "30.0.5"
36
127
  },
37
128
  "publishConfig": { "access": "public" },
38
- "gitHead": "4e34ec2f682b01c92c415c551f731eea9ce0ba56"
129
+ "gitHead": "02c8cb2e1f2bf609086789189e99224caec55688"
39
130
  }