@starci/jest-preset 2.2.6 → 2.2.7
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/CHANGELOG.md +4 -0
- package/index.cjs +18 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.2.7 - 2026-10-13
|
|
4
|
+
|
|
5
|
+
- Fixed: the ESM-only runtime dependency `jose` (the Supabase access-token verifier of every lite back end) is compiled to CommonJS by ts-jest instead of being skipped with node_modules, so a lite app's unit run can load its guard (owner ruling 2026-10-12: lite keeps full's unit run).
|
|
6
|
+
|
|
3
7
|
## 2.2.6 - 2026-10-08
|
|
4
8
|
|
|
5
9
|
- Fixed: the `integration`, `e2e` and `contract` projects match `**/src/tests/<layer>/**/*.<layer>-spec.ts` instead of a pattern prefixed with the root path. On Windows a root that holds a dot-named folder (a checkout under `.claude`) turned the path separator before it into a glob escape, so the contract run found 0 spec files ("No tests found") although they exist.
|
package/index.cjs
CHANGED
|
@@ -53,9 +53,25 @@ const TS_TRANSFORM = String.raw`^.+\.ts$`
|
|
|
53
53
|
* does not type-check.
|
|
54
54
|
*/
|
|
55
55
|
function transform(tsconfig) {
|
|
56
|
-
return { [TS_TRANSFORM]: ["ts-jest", { tsconfig, diagnostics: false }] }
|
|
56
|
+
return { [TS_TRANSFORM]: ["ts-jest", { tsconfig, diagnostics: false }], ...esmDependencyTransform() }
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
/**
|
|
60
|
+
* The runtime dependencies of a back end that ship ECMAScript modules only: jest's CommonJS runtime cannot load them, so their
|
|
61
|
+
* files are compiled to CommonJS like the repository's own (ts-jest with `allowJs`) instead of being skipped as node_modules.
|
|
62
|
+
* `jose` is the Supabase access-token verifier of every lite back end (be.integrations.supabase); a lite app keeps full's unit
|
|
63
|
+
* run (owner ruling 2026-10-12), so a spec that imports its guard must load it.
|
|
64
|
+
*/
|
|
65
|
+
const ESM_ONLY_DEPENDENCIES = Object.freeze(["jose"])
|
|
66
|
+
const ESM_DEPENDENCY_TRANSFORM = String.raw`^.+[\\/]node_modules[\\/](?:${ESM_ONLY_DEPENDENCIES.join("|")})[\\/].+\.js$`
|
|
67
|
+
|
|
68
|
+
function esmDependencyTransform() {
|
|
69
|
+
return { [ESM_DEPENDENCY_TRANSFORM]: ["ts-jest", { tsconfig: { allowJs: true, module: "commonjs", target: "es2022", esModuleInterop: true }, diagnostics: false }] }
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** node_modules stay untransformed except the ESM-only dependencies above. */
|
|
73
|
+
const TRANSFORM_IGNORE_PATTERNS = Object.freeze([String.raw`[\\/]node_modules[\\/](?!(?:${ESM_ONLY_DEPENDENCIES.join("|")})[\\/])`])
|
|
74
|
+
|
|
59
75
|
/**
|
|
60
76
|
* The compiler options the UNIT project overlays on the repository tsconfig (ts-jest merges an inline `tsconfig` object over the
|
|
61
77
|
* `tsconfig.json` it finds under `rootDir`). They exist so that per-file 100 coverage is reachable for a decorated service:
|
|
@@ -179,6 +195,7 @@ function starciJestConfig(options) {
|
|
|
179
195
|
rootDir: ".",
|
|
180
196
|
roots: ["<rootDir>/src", "<rootDir>/apps"],
|
|
181
197
|
moduleNameMapper: { ...MODULE_NAME_MAPPER },
|
|
198
|
+
transformIgnorePatterns: [...TRANSFORM_IGNORE_PATTERNS],
|
|
182
199
|
}
|
|
183
200
|
const suite = (displayName, suffix) => ({
|
|
184
201
|
...shared,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@starci/jest-preset",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.7",
|
|
4
4
|
"description": "The StarCi jest config for Nest repositories (unit, integration, e2e and contract projects, ts-jest with diagnostics off, per-file 100 coverage of *.service.ts only) and the one shared unit-test double kit: typed mock<T>(), mockEntityManager(), fakeTransaction(), fakeCache(), fakeLock(), recordingEventBus(), recordingQueueOutbox(), fakeInbox(), FakeClock, fakeIds(), builder() and the Outcome matchers toBeRefused/toSucceedWith.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|