@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.
- package/README.md +2 -1
- package/dist/index.cjs +126 -8
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +113 -7
- package/dist/jest/{config/package.cjs → declare-package.cjs} +11 -11
- package/dist/jest/declare-package.d.cts +18 -0
- package/dist/jest/declare-package.d.ts +18 -0
- package/dist/jest/declare-package.js +17 -0
- package/dist/jest/declare-preset.cjs +79 -0
- package/dist/jest/declare-preset.d.cts +5 -0
- package/dist/jest/declare-preset.d.ts +5 -0
- package/dist/jest/declare-preset.js +45 -0
- package/dist/jest/declare-workspace.cjs +97 -0
- package/dist/jest/declare-workspace.d.cts +10 -0
- package/dist/jest/declare-workspace.d.ts +10 -0
- package/dist/jest/{config/workspace.d.ts → declare-workspace.js} +34 -19
- package/dist/jest/{config/preset.cjs → preset/index.cjs} +49 -25
- package/dist/jest/preset/index.d.cts +5 -0
- package/dist/jest/preset/index.d.ts +5 -0
- package/dist/jest/preset/index.js +51 -0
- package/dist/jest/preset/jest-preset.cjs +84 -0
- package/dist/jest/{config/preset.d.cts → preset/jest-preset.d.cts} +37 -23
- package/dist/jest/{config/preset.d.ts → preset/jest-preset.d.ts} +37 -23
- package/dist/jest/preset/jest-preset.js +48 -0
- package/package.json +52 -23
- package/dist/jest/config/package.d.cts +0 -15
- package/dist/jest/config/package.d.ts +0 -15
- package/dist/jest/config/package.js +0 -17
- package/dist/jest/config/preset.js +0 -29
- package/dist/jest/config/workspace.cjs +0 -74
- package/dist/jest/config/workspace.d.cts +0 -48
- package/dist/jest/config/workspace.js +0 -54
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Config } from 'jest';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Config for Jest unit tests
|
|
5
|
+
*
|
|
6
|
+
* https://jestjs.io/docs/configuration#projects-arraystring--projectconfig
|
|
7
|
+
*/
|
|
8
|
+
declare function declareWorkspace(config?: Partial<Config>): () => Promise<Config>;
|
|
9
|
+
|
|
10
|
+
export { declareWorkspace };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Config } from 'jest';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Config for Jest unit tests
|
|
5
|
+
*
|
|
6
|
+
* https://jestjs.io/docs/configuration#projects-arraystring--projectconfig
|
|
7
|
+
*/
|
|
8
|
+
declare function declareWorkspace(config?: Partial<Config>): () => Promise<Config>;
|
|
9
|
+
|
|
10
|
+
export { declareWorkspace };
|
|
@@ -1,48 +1,63 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
declare const _default: () => Promise<{
|
|
1
|
+
// src/jest/declare-workspace.ts
|
|
2
|
+
import { getJestProjectsAsync } from "@nx/jest";
|
|
3
|
+
import defu from "defu";
|
|
4
|
+
function declareWorkspace(config = {}) {
|
|
5
|
+
return async () => defu(config, {
|
|
7
6
|
/**
|
|
8
7
|
* 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
8
|
* This is great for monorepos or when working on multiple projects at the same time.
|
|
10
9
|
*/
|
|
11
|
-
projects:
|
|
10
|
+
projects: [...await getJestProjectsAsync(), "<rootDir>/jest.config.ts"],
|
|
12
11
|
/**
|
|
13
12
|
* Indicates whether the coverage information should be collected while executing the test. Because this retrofits all
|
|
14
13
|
* executed files with coverage collection statements, it may significantly slow down your tests. Default: false
|
|
15
14
|
*/
|
|
16
|
-
collectCoverage:
|
|
15
|
+
collectCoverage: process.env.CI ? true : false,
|
|
17
16
|
/**
|
|
18
17
|
* An array of glob patterns indicating a set of files for which coverage information should be collected.
|
|
19
18
|
* If a file matches the specified glob pattern, coverage information will be collected for it even if no tests exist
|
|
20
19
|
* for this file and it's never required in the test suite. Default: undefined
|
|
21
20
|
*/
|
|
21
|
+
// collectCoverageFrom: ["**/*(!*.spec).tsx", "**/*(!*.spec).ts"],
|
|
22
22
|
/**
|
|
23
23
|
* The directory where Jest should output its coverage files. Default: undefined
|
|
24
24
|
*/
|
|
25
|
-
coverageDirectory:
|
|
25
|
+
coverageDirectory: "<rootDir>/coverage",
|
|
26
26
|
/**
|
|
27
27
|
* An array of regexp pattern strings that are matched against all file paths before executing the test. If the file path
|
|
28
28
|
* matches any of the patterns, coverage information will be skipped.
|
|
29
29
|
*/
|
|
30
|
-
coveragePathIgnorePatterns:
|
|
30
|
+
coveragePathIgnorePatterns: [
|
|
31
|
+
"\\.spec\\.ts$",
|
|
32
|
+
"\\.test\\.ts$",
|
|
33
|
+
"<rootDir>/dist",
|
|
34
|
+
"<rootDir>/tests",
|
|
35
|
+
"<rootDir>/__generated__",
|
|
36
|
+
"<rootDir>/node_modules"
|
|
37
|
+
],
|
|
31
38
|
/**
|
|
32
39
|
* The test environment that will be used for testing. The default environment in Jest is a Node.js environment.
|
|
33
40
|
* If you are building a web app, you can use a browser-like environment through jsdom instead.
|
|
34
41
|
*/
|
|
35
|
-
testEnvironment:
|
|
42
|
+
testEnvironment: "jest-environment-jsdom",
|
|
36
43
|
/**
|
|
37
44
|
* A list of reporter names that Jest uses when writing coverage reports. Any istanbul reporter can be used.
|
|
38
45
|
* Default: ["json", "lcov", "text"]
|
|
39
46
|
*/
|
|
40
|
-
coverageReporters:
|
|
41
|
-
|
|
47
|
+
coverageReporters: ["lcov", "json"],
|
|
48
|
+
/**
|
|
49
|
+
* Setup files that run before each test suite.
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
52
|
+
* This is useful for setting up global variables or configurations that your tests need.
|
|
53
|
+
*/
|
|
54
|
+
setupFiles: ["./node_modules/@storm-software/testing-tools/jest/setup"],
|
|
42
55
|
moduleNameMapper: {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export {
|
|
56
|
+
"\\.(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",
|
|
57
|
+
"\\.(css|less)$": "@storm-software/testing-tools/jest/__mocks__/style.mock.js"
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
export {
|
|
62
|
+
declareWorkspace
|
|
63
|
+
};
|
|
@@ -26,34 +26,58 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
));
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
28
|
|
|
29
|
-
// src/jest/
|
|
29
|
+
// src/jest/preset/index.ts
|
|
30
30
|
var preset_exports = {};
|
|
31
31
|
__export(preset_exports, {
|
|
32
32
|
default: () => preset_default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(preset_exports);
|
|
35
|
+
|
|
36
|
+
// src/jest/declare-preset.ts
|
|
35
37
|
var import_preset = __toESM(require("@nx/jest/preset"), 1);
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
38
|
+
var import_defu = __toESM(require("defu"), 1);
|
|
39
|
+
function declarePreset(config = {}) {
|
|
40
|
+
return (0, import_defu.default)(
|
|
41
|
+
config,
|
|
42
|
+
{
|
|
43
|
+
collectCoverage: true,
|
|
44
|
+
testTimeout: 3e4,
|
|
45
|
+
clearMocks: true,
|
|
46
|
+
testMatch: ["**/+(*.)+(spec|test).+(ts|js)?(x)"],
|
|
47
|
+
transform: {
|
|
48
|
+
"^.+\\.(ts|js|mts|mjs|cts|cjs|html)$": [
|
|
49
|
+
"ts-jest",
|
|
50
|
+
{ tsconfig: "<rootDir>/tsconfig.spec.json" }
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
snapshotFormat: {
|
|
54
|
+
printBasicPrototype: false
|
|
55
|
+
},
|
|
56
|
+
globals: {
|
|
57
|
+
"ts-jest": {
|
|
58
|
+
isolatedModules: true,
|
|
59
|
+
diagnostics: {
|
|
60
|
+
exclude: ["**"]
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
moduleFileExtensions: ["ts", "js", "html"],
|
|
65
|
+
coverageReporters: [
|
|
66
|
+
"json",
|
|
67
|
+
"lcov",
|
|
68
|
+
"text",
|
|
69
|
+
"clover",
|
|
70
|
+
"text-summary",
|
|
71
|
+
"html"
|
|
72
|
+
],
|
|
73
|
+
maxWorkers: 1
|
|
74
|
+
},
|
|
75
|
+
import_preset.default ?? {}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// src/jest/preset/jest-preset.ts
|
|
80
|
+
var stormPreset = declarePreset({});
|
|
81
|
+
|
|
82
|
+
// src/jest/preset/index.ts
|
|
83
|
+
var preset_default = stormPreset;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// src/jest/declare-preset.ts
|
|
2
|
+
import nxPreset from "@nx/jest/preset";
|
|
3
|
+
import defu from "defu";
|
|
4
|
+
function declarePreset(config = {}) {
|
|
5
|
+
return defu(
|
|
6
|
+
config,
|
|
7
|
+
{
|
|
8
|
+
collectCoverage: true,
|
|
9
|
+
testTimeout: 3e4,
|
|
10
|
+
clearMocks: true,
|
|
11
|
+
testMatch: ["**/+(*.)+(spec|test).+(ts|js)?(x)"],
|
|
12
|
+
transform: {
|
|
13
|
+
"^.+\\.(ts|js|mts|mjs|cts|cjs|html)$": [
|
|
14
|
+
"ts-jest",
|
|
15
|
+
{ tsconfig: "<rootDir>/tsconfig.spec.json" }
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
snapshotFormat: {
|
|
19
|
+
printBasicPrototype: false
|
|
20
|
+
},
|
|
21
|
+
globals: {
|
|
22
|
+
"ts-jest": {
|
|
23
|
+
isolatedModules: true,
|
|
24
|
+
diagnostics: {
|
|
25
|
+
exclude: ["**"]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
moduleFileExtensions: ["ts", "js", "html"],
|
|
30
|
+
coverageReporters: [
|
|
31
|
+
"json",
|
|
32
|
+
"lcov",
|
|
33
|
+
"text",
|
|
34
|
+
"clover",
|
|
35
|
+
"text-summary",
|
|
36
|
+
"html"
|
|
37
|
+
],
|
|
38
|
+
maxWorkers: 1
|
|
39
|
+
},
|
|
40
|
+
nxPreset ?? {}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// src/jest/preset/jest-preset.ts
|
|
45
|
+
var stormPreset = declarePreset({});
|
|
46
|
+
|
|
47
|
+
// src/jest/preset/index.ts
|
|
48
|
+
var preset_default = stormPreset;
|
|
49
|
+
export {
|
|
50
|
+
preset_default as default
|
|
51
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/jest/preset/jest-preset.ts
|
|
30
|
+
var jest_preset_exports = {};
|
|
31
|
+
__export(jest_preset_exports, {
|
|
32
|
+
stormPreset: () => stormPreset
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(jest_preset_exports);
|
|
35
|
+
|
|
36
|
+
// src/jest/declare-preset.ts
|
|
37
|
+
var import_preset = __toESM(require("@nx/jest/preset"), 1);
|
|
38
|
+
var import_defu = __toESM(require("defu"), 1);
|
|
39
|
+
function declarePreset(config = {}) {
|
|
40
|
+
return (0, import_defu.default)(
|
|
41
|
+
config,
|
|
42
|
+
{
|
|
43
|
+
collectCoverage: true,
|
|
44
|
+
testTimeout: 3e4,
|
|
45
|
+
clearMocks: true,
|
|
46
|
+
testMatch: ["**/+(*.)+(spec|test).+(ts|js)?(x)"],
|
|
47
|
+
transform: {
|
|
48
|
+
"^.+\\.(ts|js|mts|mjs|cts|cjs|html)$": [
|
|
49
|
+
"ts-jest",
|
|
50
|
+
{ tsconfig: "<rootDir>/tsconfig.spec.json" }
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
snapshotFormat: {
|
|
54
|
+
printBasicPrototype: false
|
|
55
|
+
},
|
|
56
|
+
globals: {
|
|
57
|
+
"ts-jest": {
|
|
58
|
+
isolatedModules: true,
|
|
59
|
+
diagnostics: {
|
|
60
|
+
exclude: ["**"]
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
moduleFileExtensions: ["ts", "js", "html"],
|
|
65
|
+
coverageReporters: [
|
|
66
|
+
"json",
|
|
67
|
+
"lcov",
|
|
68
|
+
"text",
|
|
69
|
+
"clover",
|
|
70
|
+
"text-summary",
|
|
71
|
+
"html"
|
|
72
|
+
],
|
|
73
|
+
maxWorkers: 1
|
|
74
|
+
},
|
|
75
|
+
import_preset.default ?? {}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// src/jest/preset/jest-preset.ts
|
|
80
|
+
var stormPreset = declarePreset({});
|
|
81
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
82
|
+
0 && (module.exports = {
|
|
83
|
+
stormPreset
|
|
84
|
+
});
|
|
@@ -1,36 +1,20 @@
|
|
|
1
|
-
declare const
|
|
2
|
-
collectCoverage: boolean;
|
|
3
|
-
testTimeout: number;
|
|
4
|
-
clearMocks: boolean;
|
|
5
|
-
testMatch: string[];
|
|
6
|
-
transform: {
|
|
7
|
-
"^.+\\.(ts|js|html)$": string;
|
|
8
|
-
};
|
|
9
|
-
snapshotFormat: {
|
|
10
|
-
printBasicPrototype: boolean;
|
|
11
|
-
};
|
|
12
|
-
globals: {
|
|
13
|
-
"ts-jest": {
|
|
14
|
-
isolatedModules: boolean;
|
|
15
|
-
diagnostics: {
|
|
16
|
-
exclude: string[];
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
moduleFileExtensions: string[];
|
|
21
|
-
coverageReporters: string[];
|
|
22
|
-
maxWorkers: number;
|
|
1
|
+
declare const stormPreset: {
|
|
23
2
|
automock?: boolean | undefined;
|
|
24
3
|
bail?: number | boolean | undefined;
|
|
25
4
|
cache?: boolean | undefined;
|
|
26
5
|
cacheDirectory?: string | undefined;
|
|
27
6
|
ci?: boolean | undefined;
|
|
7
|
+
clearMocks?: boolean | undefined;
|
|
28
8
|
changedFilesWithAncestor?: boolean | undefined;
|
|
29
9
|
changedSince?: string | undefined;
|
|
10
|
+
collectCoverage?: boolean | undefined;
|
|
30
11
|
collectCoverageFrom?: string[] | undefined;
|
|
31
12
|
coverageDirectory?: string | undefined;
|
|
32
13
|
coveragePathIgnorePatterns?: string[] | undefined;
|
|
33
14
|
coverageProvider?: "babel" | "v8" | undefined;
|
|
15
|
+
coverageReporters?: ("json" | "clover" | "cobertura" | "html-spa" | "html" | "json-summary" | "lcov" | "lcovonly" | "none" | "teamcity" | "text" | "text-lcov" | "text-summary" | ["json" | "clover" | "cobertura" | "html-spa" | "html" | "json-summary" | "lcov" | "lcovonly" | "none" | "teamcity" | "text" | "text-lcov" | "text-summary", {
|
|
16
|
+
[x: string]: unknown;
|
|
17
|
+
}])[] | undefined;
|
|
34
18
|
coverageThreshold?: {
|
|
35
19
|
[path: string]: {
|
|
36
20
|
branches?: number | undefined;
|
|
@@ -70,6 +54,9 @@ declare const _default: {
|
|
|
70
54
|
forceCoverageMatch?: string[] | undefined;
|
|
71
55
|
forceExit?: boolean | undefined;
|
|
72
56
|
json?: boolean | undefined;
|
|
57
|
+
globals?: {
|
|
58
|
+
[x: string]: unknown;
|
|
59
|
+
} | undefined;
|
|
73
60
|
globalSetup?: string | null | undefined;
|
|
74
61
|
globalTeardown?: string | null | undefined;
|
|
75
62
|
haste?: {
|
|
@@ -92,7 +79,9 @@ declare const _default: {
|
|
|
92
79
|
lastCommit?: boolean | undefined;
|
|
93
80
|
listTests?: boolean | undefined;
|
|
94
81
|
maxConcurrency?: number | undefined;
|
|
82
|
+
maxWorkers?: string | number | undefined;
|
|
95
83
|
moduleDirectories?: string[] | undefined;
|
|
84
|
+
moduleFileExtensions?: string[] | undefined;
|
|
96
85
|
moduleNameMapper?: {
|
|
97
86
|
[x: string]: string | string[];
|
|
98
87
|
} | undefined;
|
|
@@ -132,6 +121,26 @@ declare const _default: {
|
|
|
132
121
|
slowTestThreshold?: number | undefined;
|
|
133
122
|
snapshotResolver?: string | undefined;
|
|
134
123
|
snapshotSerializers?: string[] | undefined;
|
|
124
|
+
snapshotFormat?: {
|
|
125
|
+
callToJSON?: boolean | undefined;
|
|
126
|
+
compareKeys?: null | undefined;
|
|
127
|
+
escapeRegex?: boolean | undefined;
|
|
128
|
+
escapeString?: boolean | undefined;
|
|
129
|
+
highlight?: boolean | undefined;
|
|
130
|
+
indent?: number | undefined;
|
|
131
|
+
maxDepth?: number | undefined;
|
|
132
|
+
maxWidth?: number | undefined;
|
|
133
|
+
min?: boolean | undefined;
|
|
134
|
+
printBasicPrototype?: boolean | undefined;
|
|
135
|
+
printFunctionName?: boolean | undefined;
|
|
136
|
+
theme?: {
|
|
137
|
+
comment?: string | undefined;
|
|
138
|
+
content?: string | undefined;
|
|
139
|
+
prop?: string | undefined;
|
|
140
|
+
tag?: string | undefined;
|
|
141
|
+
value?: string | undefined;
|
|
142
|
+
} | undefined;
|
|
143
|
+
} | undefined;
|
|
135
144
|
errorOnDeprecated?: boolean | undefined;
|
|
136
145
|
testEnvironment?: string | undefined;
|
|
137
146
|
testEnvironmentOptions?: {
|
|
@@ -139,12 +148,17 @@ declare const _default: {
|
|
|
139
148
|
} | undefined;
|
|
140
149
|
testFailureExitCode?: number | undefined;
|
|
141
150
|
testLocationInResults?: boolean | undefined;
|
|
151
|
+
testMatch?: string | string[] | undefined;
|
|
142
152
|
testNamePattern?: string | undefined;
|
|
143
153
|
testPathIgnorePatterns?: string[] | undefined;
|
|
144
154
|
testRegex?: string | string[] | undefined;
|
|
145
155
|
testResultsProcessor?: string | undefined;
|
|
146
156
|
testRunner?: string | undefined;
|
|
147
157
|
testSequencer?: string | undefined;
|
|
158
|
+
testTimeout?: number | undefined;
|
|
159
|
+
transform?: {
|
|
160
|
+
[x: string]: string | [string, unknown];
|
|
161
|
+
} | undefined;
|
|
148
162
|
transformIgnorePatterns?: string[] | undefined;
|
|
149
163
|
watchPathIgnorePatterns?: string[] | undefined;
|
|
150
164
|
unmockedModulePathPatterns?: string[] | undefined;
|
|
@@ -160,4 +174,4 @@ declare const _default: {
|
|
|
160
174
|
workerThreads?: boolean | undefined;
|
|
161
175
|
};
|
|
162
176
|
|
|
163
|
-
export {
|
|
177
|
+
export { stormPreset };
|
|
@@ -1,36 +1,20 @@
|
|
|
1
|
-
declare const
|
|
2
|
-
collectCoverage: boolean;
|
|
3
|
-
testTimeout: number;
|
|
4
|
-
clearMocks: boolean;
|
|
5
|
-
testMatch: string[];
|
|
6
|
-
transform: {
|
|
7
|
-
"^.+\\.(ts|js|html)$": string;
|
|
8
|
-
};
|
|
9
|
-
snapshotFormat: {
|
|
10
|
-
printBasicPrototype: boolean;
|
|
11
|
-
};
|
|
12
|
-
globals: {
|
|
13
|
-
"ts-jest": {
|
|
14
|
-
isolatedModules: boolean;
|
|
15
|
-
diagnostics: {
|
|
16
|
-
exclude: string[];
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
moduleFileExtensions: string[];
|
|
21
|
-
coverageReporters: string[];
|
|
22
|
-
maxWorkers: number;
|
|
1
|
+
declare const stormPreset: {
|
|
23
2
|
automock?: boolean | undefined;
|
|
24
3
|
bail?: number | boolean | undefined;
|
|
25
4
|
cache?: boolean | undefined;
|
|
26
5
|
cacheDirectory?: string | undefined;
|
|
27
6
|
ci?: boolean | undefined;
|
|
7
|
+
clearMocks?: boolean | undefined;
|
|
28
8
|
changedFilesWithAncestor?: boolean | undefined;
|
|
29
9
|
changedSince?: string | undefined;
|
|
10
|
+
collectCoverage?: boolean | undefined;
|
|
30
11
|
collectCoverageFrom?: string[] | undefined;
|
|
31
12
|
coverageDirectory?: string | undefined;
|
|
32
13
|
coveragePathIgnorePatterns?: string[] | undefined;
|
|
33
14
|
coverageProvider?: "babel" | "v8" | undefined;
|
|
15
|
+
coverageReporters?: ("json" | "clover" | "cobertura" | "html-spa" | "html" | "json-summary" | "lcov" | "lcovonly" | "none" | "teamcity" | "text" | "text-lcov" | "text-summary" | ["json" | "clover" | "cobertura" | "html-spa" | "html" | "json-summary" | "lcov" | "lcovonly" | "none" | "teamcity" | "text" | "text-lcov" | "text-summary", {
|
|
16
|
+
[x: string]: unknown;
|
|
17
|
+
}])[] | undefined;
|
|
34
18
|
coverageThreshold?: {
|
|
35
19
|
[path: string]: {
|
|
36
20
|
branches?: number | undefined;
|
|
@@ -70,6 +54,9 @@ declare const _default: {
|
|
|
70
54
|
forceCoverageMatch?: string[] | undefined;
|
|
71
55
|
forceExit?: boolean | undefined;
|
|
72
56
|
json?: boolean | undefined;
|
|
57
|
+
globals?: {
|
|
58
|
+
[x: string]: unknown;
|
|
59
|
+
} | undefined;
|
|
73
60
|
globalSetup?: string | null | undefined;
|
|
74
61
|
globalTeardown?: string | null | undefined;
|
|
75
62
|
haste?: {
|
|
@@ -92,7 +79,9 @@ declare const _default: {
|
|
|
92
79
|
lastCommit?: boolean | undefined;
|
|
93
80
|
listTests?: boolean | undefined;
|
|
94
81
|
maxConcurrency?: number | undefined;
|
|
82
|
+
maxWorkers?: string | number | undefined;
|
|
95
83
|
moduleDirectories?: string[] | undefined;
|
|
84
|
+
moduleFileExtensions?: string[] | undefined;
|
|
96
85
|
moduleNameMapper?: {
|
|
97
86
|
[x: string]: string | string[];
|
|
98
87
|
} | undefined;
|
|
@@ -132,6 +121,26 @@ declare const _default: {
|
|
|
132
121
|
slowTestThreshold?: number | undefined;
|
|
133
122
|
snapshotResolver?: string | undefined;
|
|
134
123
|
snapshotSerializers?: string[] | undefined;
|
|
124
|
+
snapshotFormat?: {
|
|
125
|
+
callToJSON?: boolean | undefined;
|
|
126
|
+
compareKeys?: null | undefined;
|
|
127
|
+
escapeRegex?: boolean | undefined;
|
|
128
|
+
escapeString?: boolean | undefined;
|
|
129
|
+
highlight?: boolean | undefined;
|
|
130
|
+
indent?: number | undefined;
|
|
131
|
+
maxDepth?: number | undefined;
|
|
132
|
+
maxWidth?: number | undefined;
|
|
133
|
+
min?: boolean | undefined;
|
|
134
|
+
printBasicPrototype?: boolean | undefined;
|
|
135
|
+
printFunctionName?: boolean | undefined;
|
|
136
|
+
theme?: {
|
|
137
|
+
comment?: string | undefined;
|
|
138
|
+
content?: string | undefined;
|
|
139
|
+
prop?: string | undefined;
|
|
140
|
+
tag?: string | undefined;
|
|
141
|
+
value?: string | undefined;
|
|
142
|
+
} | undefined;
|
|
143
|
+
} | undefined;
|
|
135
144
|
errorOnDeprecated?: boolean | undefined;
|
|
136
145
|
testEnvironment?: string | undefined;
|
|
137
146
|
testEnvironmentOptions?: {
|
|
@@ -139,12 +148,17 @@ declare const _default: {
|
|
|
139
148
|
} | undefined;
|
|
140
149
|
testFailureExitCode?: number | undefined;
|
|
141
150
|
testLocationInResults?: boolean | undefined;
|
|
151
|
+
testMatch?: string | string[] | undefined;
|
|
142
152
|
testNamePattern?: string | undefined;
|
|
143
153
|
testPathIgnorePatterns?: string[] | undefined;
|
|
144
154
|
testRegex?: string | string[] | undefined;
|
|
145
155
|
testResultsProcessor?: string | undefined;
|
|
146
156
|
testRunner?: string | undefined;
|
|
147
157
|
testSequencer?: string | undefined;
|
|
158
|
+
testTimeout?: number | undefined;
|
|
159
|
+
transform?: {
|
|
160
|
+
[x: string]: string | [string, unknown];
|
|
161
|
+
} | undefined;
|
|
148
162
|
transformIgnorePatterns?: string[] | undefined;
|
|
149
163
|
watchPathIgnorePatterns?: string[] | undefined;
|
|
150
164
|
unmockedModulePathPatterns?: string[] | undefined;
|
|
@@ -160,4 +174,4 @@ declare const _default: {
|
|
|
160
174
|
workerThreads?: boolean | undefined;
|
|
161
175
|
};
|
|
162
176
|
|
|
163
|
-
export {
|
|
177
|
+
export { stormPreset };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// src/jest/declare-preset.ts
|
|
2
|
+
import nxPreset from "@nx/jest/preset";
|
|
3
|
+
import defu from "defu";
|
|
4
|
+
function declarePreset(config = {}) {
|
|
5
|
+
return defu(
|
|
6
|
+
config,
|
|
7
|
+
{
|
|
8
|
+
collectCoverage: true,
|
|
9
|
+
testTimeout: 3e4,
|
|
10
|
+
clearMocks: true,
|
|
11
|
+
testMatch: ["**/+(*.)+(spec|test).+(ts|js)?(x)"],
|
|
12
|
+
transform: {
|
|
13
|
+
"^.+\\.(ts|js|mts|mjs|cts|cjs|html)$": [
|
|
14
|
+
"ts-jest",
|
|
15
|
+
{ tsconfig: "<rootDir>/tsconfig.spec.json" }
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
snapshotFormat: {
|
|
19
|
+
printBasicPrototype: false
|
|
20
|
+
},
|
|
21
|
+
globals: {
|
|
22
|
+
"ts-jest": {
|
|
23
|
+
isolatedModules: true,
|
|
24
|
+
diagnostics: {
|
|
25
|
+
exclude: ["**"]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
moduleFileExtensions: ["ts", "js", "html"],
|
|
30
|
+
coverageReporters: [
|
|
31
|
+
"json",
|
|
32
|
+
"lcov",
|
|
33
|
+
"text",
|
|
34
|
+
"clover",
|
|
35
|
+
"text-summary",
|
|
36
|
+
"html"
|
|
37
|
+
],
|
|
38
|
+
maxWorkers: 1
|
|
39
|
+
},
|
|
40
|
+
nxPreset ?? {}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// src/jest/preset/jest-preset.ts
|
|
45
|
+
var stormPreset = declarePreset({});
|
|
46
|
+
export {
|
|
47
|
+
stormPreset
|
|
48
|
+
};
|