skuba 7.5.2-jest-node-next-20240319070034 → 8.0.0-master-20240325021242
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/lib/api/jest/index.d.ts +1 -133
- package/package.json +8 -8
- package/template/express-rest-api/package.json +1 -1
- package/template/greeter/package.json +1 -1
- package/template/koa-rest-api/package.json +1 -1
- package/template/lambda-sqs-worker/package.json +1 -1
- package/template/lambda-sqs-worker-cdk/package.json +1 -1
- package/jest/moduleNameMapper.test.ts +0 -64
- package/jest/transform.test.ts +0 -13
package/lib/api/jest/index.d.ts
CHANGED
|
@@ -12,136 +12,4 @@ type DefaultOptions = 'collectCoverage' | 'collectCoverageFrom' | 'coveragePathI
|
|
|
12
12
|
*
|
|
13
13
|
* This concatenates array options like `testPathIgnorePatterns`.
|
|
14
14
|
*/
|
|
15
|
-
export declare const mergePreset: <AdditionalOptions extends "filter" | "json" | "silent" | "transform" | "cache" | "runtime" | "watch" | "runner" | "projects" | "id" | "automock" | "cacheDirectory" | "clearMocks" | "collectCoverageFrom" | "coverageDirectory" | "coveragePathIgnorePatterns" | "dependencyExtractor" | "detectLeaks" | "detectOpenHandles" | "displayName" | "errorOnDeprecated" | "extensionsToTreatAsEsm" | "fakeTimers" | "forceCoverageMatch" | "globalSetup" | "globalTeardown" | "globals" | "haste" | "injectGlobals" | "moduleDirectories" | "moduleFileExtensions" | "moduleNameMapper" | "modulePathIgnorePatterns" | "modulePaths" | "openHandlesTimeout" | "preset" | "prettierPath" | "resetMocks" | "resetModules" | "resolver" | "restoreMocks" | "rootDir" | "roots" | "sandboxInjectedGlobals" | "setupFiles" | "setupFilesAfterEnv" | "skipFilter" | "skipNodeResolution" | "slowTestThreshold" | "snapshotResolver" | "snapshotSerializers" | "snapshotFormat" | "testEnvironment" | "testEnvironmentOptions" | "testMatch" | "testLocationInResults" | "testPathIgnorePatterns" | "testRegex" | "testRunner" | "transformIgnorePatterns" | "watchPathIgnorePatterns" | "unmockedModulePathPatterns" | "workerIdleMemoryLimit" | "bail" | "ci" | "changedFilesWithAncestor" | "changedSince" | "collectCoverage" | "coverageProvider" | "coverageReporters" | "coverageThreshold" | "expand" | "findRelatedTests" | "forceExit" | "reporters" | "logHeapUsage" | "lastCommit" | "listTests" | "maxConcurrency" | "maxWorkers" | "noStackTrace" | "notify" | "notifyMode" | "onlyChanged" | "onlyFailures" | "outputFile" | "passWithNoTests" | "randomize" | "replname" | "runTestsByPath" | "showSeed" | "testFailureExitCode" | "testNamePattern" | "testResultsProcessor" | "testSequencer" | "testTimeout" | "updateSnapshot" | "useStderr" | "verbose" | "watchAll" | "watchman" | "watchPlugins" | "workerThreads">({ projects, ...options }: Pick<
|
|
16
|
-
automock: boolean;
|
|
17
|
-
bail: number | boolean;
|
|
18
|
-
cache: boolean;
|
|
19
|
-
cacheDirectory: string;
|
|
20
|
-
ci: boolean;
|
|
21
|
-
clearMocks: boolean;
|
|
22
|
-
changedFilesWithAncestor: boolean;
|
|
23
|
-
changedSince: string;
|
|
24
|
-
collectCoverage: boolean;
|
|
25
|
-
collectCoverageFrom: string[];
|
|
26
|
-
coverageDirectory: string;
|
|
27
|
-
coveragePathIgnorePatterns: string[];
|
|
28
|
-
coverageProvider: "v8" | "babel";
|
|
29
|
-
coverageReporters: Config.CoverageReporters;
|
|
30
|
-
coverageThreshold: {
|
|
31
|
-
[path: string]: Config.CoverageThresholdValue;
|
|
32
|
-
global: Config.CoverageThresholdValue;
|
|
33
|
-
};
|
|
34
|
-
dependencyExtractor: string;
|
|
35
|
-
detectLeaks: boolean;
|
|
36
|
-
detectOpenHandles: boolean;
|
|
37
|
-
displayName: string | Config.DisplayName;
|
|
38
|
-
expand: boolean;
|
|
39
|
-
extensionsToTreatAsEsm: string[];
|
|
40
|
-
fakeTimers: Config.GlobalFakeTimersConfig & ((Config.FakeTimersConfig & {
|
|
41
|
-
now?: number | undefined;
|
|
42
|
-
}) | Config.LegacyFakeTimersConfig);
|
|
43
|
-
filter: string;
|
|
44
|
-
findRelatedTests: boolean;
|
|
45
|
-
forceCoverageMatch: string[];
|
|
46
|
-
forceExit: boolean;
|
|
47
|
-
json: boolean;
|
|
48
|
-
globals: Config.ConfigGlobals;
|
|
49
|
-
globalSetup: string | null | undefined;
|
|
50
|
-
globalTeardown: string | null | undefined;
|
|
51
|
-
haste: Config.HasteConfig;
|
|
52
|
-
id: string;
|
|
53
|
-
injectGlobals: boolean;
|
|
54
|
-
reporters: (string | Config.ReporterConfig)[];
|
|
55
|
-
logHeapUsage: boolean;
|
|
56
|
-
lastCommit: boolean;
|
|
57
|
-
listTests: boolean;
|
|
58
|
-
maxConcurrency: number;
|
|
59
|
-
maxWorkers: string | number;
|
|
60
|
-
moduleDirectories: string[];
|
|
61
|
-
moduleFileExtensions: string[];
|
|
62
|
-
moduleNameMapper: {
|
|
63
|
-
[key: string]: string | string[];
|
|
64
|
-
};
|
|
65
|
-
modulePathIgnorePatterns: string[];
|
|
66
|
-
modulePaths: string[];
|
|
67
|
-
noStackTrace: boolean;
|
|
68
|
-
notify: boolean;
|
|
69
|
-
notifyMode: string;
|
|
70
|
-
onlyChanged: boolean;
|
|
71
|
-
onlyFailures: boolean;
|
|
72
|
-
openHandlesTimeout: number;
|
|
73
|
-
outputFile: string;
|
|
74
|
-
passWithNoTests: boolean;
|
|
75
|
-
preset: string | null | undefined;
|
|
76
|
-
prettierPath: string | null | undefined;
|
|
77
|
-
projects: (string | Config.InitialProjectOptions)[];
|
|
78
|
-
randomize: boolean;
|
|
79
|
-
replname: string | null | undefined;
|
|
80
|
-
resetMocks: boolean;
|
|
81
|
-
resetModules: boolean;
|
|
82
|
-
resolver: string | null | undefined;
|
|
83
|
-
restoreMocks: boolean;
|
|
84
|
-
rootDir: string;
|
|
85
|
-
roots: string[];
|
|
86
|
-
runner: string;
|
|
87
|
-
runTestsByPath: boolean;
|
|
88
|
-
runtime: string;
|
|
89
|
-
sandboxInjectedGlobals: string[];
|
|
90
|
-
setupFiles: string[];
|
|
91
|
-
setupFilesAfterEnv: string[];
|
|
92
|
-
showSeed: boolean;
|
|
93
|
-
silent: boolean;
|
|
94
|
-
skipFilter: boolean;
|
|
95
|
-
skipNodeResolution: boolean;
|
|
96
|
-
slowTestThreshold: number;
|
|
97
|
-
snapshotResolver: string;
|
|
98
|
-
snapshotSerializers: string[];
|
|
99
|
-
snapshotFormat: {
|
|
100
|
-
readonly min?: boolean | undefined;
|
|
101
|
-
readonly callToJSON?: boolean | undefined;
|
|
102
|
-
readonly compareKeys?: null | undefined;
|
|
103
|
-
readonly escapeRegex?: boolean | undefined;
|
|
104
|
-
readonly escapeString?: boolean | undefined;
|
|
105
|
-
readonly highlight?: boolean | undefined;
|
|
106
|
-
readonly indent?: number | undefined;
|
|
107
|
-
readonly maxDepth?: number | undefined;
|
|
108
|
-
readonly maxWidth?: number | undefined;
|
|
109
|
-
readonly printBasicPrototype?: boolean | undefined;
|
|
110
|
-
readonly printFunctionName?: boolean | undefined;
|
|
111
|
-
readonly theme?: {
|
|
112
|
-
readonly value?: string | undefined;
|
|
113
|
-
readonly tag?: string | undefined;
|
|
114
|
-
readonly content?: string | undefined;
|
|
115
|
-
readonly comment?: string | undefined;
|
|
116
|
-
readonly prop?: string | undefined;
|
|
117
|
-
} | undefined;
|
|
118
|
-
};
|
|
119
|
-
errorOnDeprecated: boolean;
|
|
120
|
-
testEnvironment: string;
|
|
121
|
-
testEnvironmentOptions: Record<string, unknown>;
|
|
122
|
-
testFailureExitCode: string | number;
|
|
123
|
-
testLocationInResults: boolean;
|
|
124
|
-
testMatch: string[];
|
|
125
|
-
testNamePattern: string;
|
|
126
|
-
testPathIgnorePatterns: string[];
|
|
127
|
-
testRegex: string | string[];
|
|
128
|
-
testResultsProcessor: string;
|
|
129
|
-
testRunner: string;
|
|
130
|
-
testSequencer: string;
|
|
131
|
-
testTimeout: number;
|
|
132
|
-
transform: {
|
|
133
|
-
[regex: string]: string | Config.TransformerConfig;
|
|
134
|
-
};
|
|
135
|
-
transformIgnorePatterns: string[];
|
|
136
|
-
watchPathIgnorePatterns: string[];
|
|
137
|
-
unmockedModulePathPatterns: string[];
|
|
138
|
-
updateSnapshot: boolean;
|
|
139
|
-
useStderr: boolean;
|
|
140
|
-
verbose?: boolean | undefined;
|
|
141
|
-
watch: boolean;
|
|
142
|
-
watchAll: boolean;
|
|
143
|
-
watchman: boolean;
|
|
144
|
-
watchPlugins: (string | [string, Record<string, unknown>])[];
|
|
145
|
-
workerIdleMemoryLimit: string | number;
|
|
146
|
-
workerThreads: boolean;
|
|
147
|
-
}>, DefaultOptions | AdditionalOptions>) => Config.InitialOptions;
|
|
15
|
+
export declare const mergePreset: <AdditionalOptions extends "filter" | "json" | "silent" | "transform" | "cache" | "runtime" | "watch" | "runner" | "projects" | "id" | "automock" | "cacheDirectory" | "clearMocks" | "collectCoverageFrom" | "coverageDirectory" | "coveragePathIgnorePatterns" | "dependencyExtractor" | "detectLeaks" | "detectOpenHandles" | "displayName" | "errorOnDeprecated" | "extensionsToTreatAsEsm" | "fakeTimers" | "forceCoverageMatch" | "globalSetup" | "globalTeardown" | "globals" | "haste" | "injectGlobals" | "moduleDirectories" | "moduleFileExtensions" | "moduleNameMapper" | "modulePathIgnorePatterns" | "modulePaths" | "openHandlesTimeout" | "preset" | "prettierPath" | "resetMocks" | "resetModules" | "resolver" | "restoreMocks" | "rootDir" | "roots" | "sandboxInjectedGlobals" | "setupFiles" | "setupFilesAfterEnv" | "skipFilter" | "skipNodeResolution" | "slowTestThreshold" | "snapshotResolver" | "snapshotSerializers" | "snapshotFormat" | "testEnvironment" | "testEnvironmentOptions" | "testMatch" | "testLocationInResults" | "testPathIgnorePatterns" | "testRegex" | "testRunner" | "transformIgnorePatterns" | "watchPathIgnorePatterns" | "unmockedModulePathPatterns" | "workerIdleMemoryLimit" | "bail" | "ci" | "changedFilesWithAncestor" | "changedSince" | "collectCoverage" | "coverageProvider" | "coverageReporters" | "coverageThreshold" | "expand" | "findRelatedTests" | "forceExit" | "reporters" | "logHeapUsage" | "lastCommit" | "listTests" | "maxConcurrency" | "maxWorkers" | "noStackTrace" | "notify" | "notifyMode" | "onlyChanged" | "onlyFailures" | "outputFile" | "passWithNoTests" | "randomize" | "replname" | "runTestsByPath" | "showSeed" | "testFailureExitCode" | "testNamePattern" | "testResultsProcessor" | "testSequencer" | "testTimeout" | "updateSnapshot" | "useStderr" | "verbose" | "watchAll" | "watchman" | "watchPlugins" | "workerThreads">({ projects, ...options }: Pick<Config.InitialOptions, AdditionalOptions | DefaultOptions>) => Config.InitialOptions;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skuba",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-master-20240325021242",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "SEEK development toolkit for backend applications and packages",
|
|
6
6
|
"homepage": "https://github.com/seek-oss/skuba#readme",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
|
22
22
|
"config/**/*",
|
|
23
|
-
"jest
|
|
23
|
+
"jest/**/*.js",
|
|
24
24
|
"lib*/**/*.d.ts",
|
|
25
25
|
"lib*/**/*.js",
|
|
26
26
|
"lib*/**/*.js.map",
|
|
@@ -66,7 +66,6 @@
|
|
|
66
66
|
"enquirer": "^2.3.6",
|
|
67
67
|
"esbuild": "~0.20.0",
|
|
68
68
|
"eslint": "^8.11.0",
|
|
69
|
-
"eslint-config-skuba": "3.1.0",
|
|
70
69
|
"execa": "^5.0.0",
|
|
71
70
|
"fast-glob": "^3.3.2",
|
|
72
71
|
"fs-extra": "^11.0.0",
|
|
@@ -88,7 +87,7 @@
|
|
|
88
87
|
"prettier": "~3.2.5",
|
|
89
88
|
"prettier-plugin-packagejson": "^2.4.10",
|
|
90
89
|
"read-pkg-up": "^7.0.1",
|
|
91
|
-
"semantic-release": "^
|
|
90
|
+
"semantic-release": "^22.0.12",
|
|
92
91
|
"serialize-error": "^8.0.1",
|
|
93
92
|
"simple-git": "^3.5.0",
|
|
94
93
|
"strip-ansi": "^6.0.1",
|
|
@@ -98,9 +97,10 @@
|
|
|
98
97
|
"ts-node-dev": "^2.0.0",
|
|
99
98
|
"tsconfig-paths": "^4.0.0",
|
|
100
99
|
"tsconfig-seek": "2.0.0",
|
|
101
|
-
"typescript": "~5.
|
|
100
|
+
"typescript": "~5.4.0",
|
|
102
101
|
"validate-npm-package-name": "^5.0.0",
|
|
103
|
-
"zod": "^3.22.4"
|
|
102
|
+
"zod": "^3.22.4",
|
|
103
|
+
"eslint-config-skuba": "4.0.0-master-20240325021242"
|
|
104
104
|
},
|
|
105
105
|
"devDependencies": {
|
|
106
106
|
"@changesets/cli": "2.27.1",
|
|
@@ -139,9 +139,9 @@
|
|
|
139
139
|
"optional": true
|
|
140
140
|
}
|
|
141
141
|
},
|
|
142
|
-
"packageManager": "pnpm@8.15.
|
|
142
|
+
"packageManager": "pnpm@8.15.5",
|
|
143
143
|
"engines": {
|
|
144
|
-
"node": ">=18.
|
|
144
|
+
"node": ">=18.18.0"
|
|
145
145
|
},
|
|
146
146
|
"publishConfig": {
|
|
147
147
|
"provenance": true
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { createModuleNameMapper } from './moduleNameMapper';
|
|
2
|
-
|
|
3
|
-
describe('moduleNameMapper', () => {
|
|
4
|
-
const act = (paths?: unknown, baseUrl?: string) =>
|
|
5
|
-
createModuleNameMapper(() => ({
|
|
6
|
-
compilerOptions: {
|
|
7
|
-
baseUrl,
|
|
8
|
-
paths,
|
|
9
|
-
},
|
|
10
|
-
}));
|
|
11
|
-
|
|
12
|
-
it('expands wildcard paths', () =>
|
|
13
|
-
expect(act({ 'src/*': ['src/*'], 'lib/wip/*': ['lib/wip/*'] }))
|
|
14
|
-
.toMatchInlineSnapshot(`
|
|
15
|
-
{
|
|
16
|
-
"^lib/wip$": "<rootDir>/lib/wip",
|
|
17
|
-
"^lib/wip/(.*)$": "<rootDir>/lib/wip/$1",
|
|
18
|
-
"^src$": "<rootDir>/src",
|
|
19
|
-
"^src/(.*)$": "<rootDir>/src/$1",
|
|
20
|
-
}
|
|
21
|
-
`));
|
|
22
|
-
|
|
23
|
-
it('expands non-wildcard paths', () =>
|
|
24
|
-
expect(act({ cli: ['cli'], 'src/': ['src/'] })).toMatchInlineSnapshot(`
|
|
25
|
-
{
|
|
26
|
-
"^cli$": "<rootDir>/cli",
|
|
27
|
-
"^cli/(.*)$": "<rootDir>/cli/$1",
|
|
28
|
-
"^src$": "<rootDir>/src",
|
|
29
|
-
"^src/(.*)$": "<rootDir>/src/$1",
|
|
30
|
-
}
|
|
31
|
-
`));
|
|
32
|
-
|
|
33
|
-
it('expands duplicate asymmetric paths', () =>
|
|
34
|
-
expect(
|
|
35
|
-
act({
|
|
36
|
-
jquery: ['node_modules/jquery/dist/jquery'],
|
|
37
|
-
'jquery/*': ['node_modules/jquery/dist/jquery/*'],
|
|
38
|
-
}),
|
|
39
|
-
).toMatchInlineSnapshot(`
|
|
40
|
-
{
|
|
41
|
-
"^jquery$": "<rootDir>/node_modules/jquery/dist/jquery",
|
|
42
|
-
"^jquery/(.*)$": "<rootDir>/node_modules/jquery/dist/jquery/$1",
|
|
43
|
-
}
|
|
44
|
-
`));
|
|
45
|
-
|
|
46
|
-
it('respects a base URL', () =>
|
|
47
|
-
expect(act({ cli: ['../cli'], 'app/*': ['app/*'] }, 'src'))
|
|
48
|
-
.toMatchInlineSnapshot(`
|
|
49
|
-
{
|
|
50
|
-
"^app$": "<rootDir>/src/app",
|
|
51
|
-
"^app/(.*)$": "<rootDir>/src/app/$1",
|
|
52
|
-
"^cli$": "<rootDir>/cli",
|
|
53
|
-
"^cli/(.*)$": "<rootDir>/cli/$1",
|
|
54
|
-
}
|
|
55
|
-
`));
|
|
56
|
-
|
|
57
|
-
it('respects no paths', () => expect(act({})).toMatchInlineSnapshot(`{}`));
|
|
58
|
-
|
|
59
|
-
it('defaults to no paths on undefined', () =>
|
|
60
|
-
expect(act(undefined)).toMatchInlineSnapshot(`{}`));
|
|
61
|
-
|
|
62
|
-
it('defaults to no paths on invalid config', () =>
|
|
63
|
-
expect(act('INVALID')).toMatchInlineSnapshot(`{}`));
|
|
64
|
-
});
|
package/jest/transform.test.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { transform } from './transform';
|
|
2
|
-
|
|
3
|
-
test('transform', () =>
|
|
4
|
-
expect(transform).toStrictEqual({
|
|
5
|
-
'^.+\\.tsx?$': [
|
|
6
|
-
expect.stringMatching(
|
|
7
|
-
/\/skuba\/node_modules\/.*\/?ts-jest\/dist\/index\.js$/,
|
|
8
|
-
),
|
|
9
|
-
{
|
|
10
|
-
isolatedModules: true,
|
|
11
|
-
},
|
|
12
|
-
],
|
|
13
|
-
}));
|