test-fns 1.15.4 → 1.15.6
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/dist/domain.operations/genTempDir/genEphemeralTempDir.js +2 -2
- package/dist/domain.operations/genTempDir/genEphemeralTempDir.js.map +1 -1
- package/dist/domain.operations/genTempDir/genTempDir.js +1 -1
- package/dist/domain.operations/genTempDir/genTempDir.js.map +1 -1
- package/dist/domain.operations/slowtestReporter/reporter/SlowtestReporterJest.js +4 -4
- package/dist/domain.operations/slowtestReporter/reporter/SlowtestReporterJest.js.map +1 -1
- package/dist/domain.operations/slowtestReporter/reporter/SlowtestReporterVitest.js +4 -4
- package/dist/domain.operations/slowtestReporter/reporter/SlowtestReporterVitest.js.map +1 -1
- package/dist/infra/isomorph.fs/findsertSymlink.d.ts +16 -1
- package/dist/infra/isomorph.fs/findsertSymlink.js +63 -35
- package/dist/infra/isomorph.fs/findsertSymlink.js.map +1 -1
- package/package.json +19 -14
|
@@ -24,12 +24,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.genEphemeralTempDir = void 0;
|
|
27
|
-
const fs = __importStar(require("node:fs"));
|
|
28
|
-
const path = __importStar(require("node:path"));
|
|
29
27
|
const cloneFixture_1 = require("../../infra/isomorph.fs/cloneFixture");
|
|
30
28
|
const commitGitChanges_1 = require("../../infra/isomorph.fs/commitGitChanges");
|
|
31
29
|
const createSymlinks_1 = require("../../infra/isomorph.fs/createSymlinks");
|
|
32
30
|
const initGitRepo_1 = require("../../infra/isomorph.fs/initGitRepo");
|
|
31
|
+
const fs = __importStar(require("node:fs"));
|
|
32
|
+
const path = __importStar(require("node:path"));
|
|
33
33
|
const asExplicitGitOptions_1 = require("./asExplicitGitOptions");
|
|
34
34
|
const computeTempDirName_1 = require("./computeTempDirName");
|
|
35
35
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genEphemeralTempDir.js","sourceRoot":"","sources":["../../../src/domain.operations/genTempDir/genEphemeralTempDir.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"genEphemeralTempDir.js","sourceRoot":"","sources":["../../../src/domain.operations/genTempDir/genEphemeralTempDir.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sEAAmE;AACnE,8EAA2E;AAC3E,0EAAuE;AACvE,oEAAiE;AAEjE,4CAA8B;AAC9B,gDAAkC;AAClC,iEAA+E;AAC/E,6DAA0D;AAE1D;;;;;GAKG;AACI,MAAM,mBAAmB,GAAG,CAAC,KAOnC,EAAU,EAAE;IACX,gCAAgC;IAChC,MAAM,OAAO,GAAG,IAAA,uCAAkB,EAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;IAEzD,6CAA6C;IAC7C,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IACjE,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAE3C,sBAAsB;IACtB,MAAM,UAAU,GAAG,IAAA,2CAAoB,EAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAEnD,mCAAmC;IACnC,IAAI,UAAU,EAAE,CAAC;QACf,IAAA,yBAAW,EAAC,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;QAE9B,6CAA6C;QAC7C,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAC5B,IAAA,mCAAgB,EAAC,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;IAED,6BAA6B;IAC7B,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QAChB,qCAAqC;QACrC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QAC3D,IAAA,2BAAY,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,qFAAqF;IACrF,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9C,IAAA,+BAAc,EAAC;YACb,QAAQ,EAAE,KAAK,CAAC,OAAO;YACvB,OAAO;YACP,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,CAAC,CAAC;IACL,CAAC;IAED,yFAAyF;IACzF,MAAM,UAAU,GAAG,CAAC,CAAC,CACnB,KAAK,CAAC,KAAK;QACX,CAAC,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAC5C,CAAC;IACF,IAAI,UAAU,IAAI,UAAU,CAAC,OAAO,CAAC,OAAO,IAAI,UAAU,EAAE,CAAC;QAC3D,IAAA,mCAAgB,EAAC,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAtDW,QAAA,mBAAmB,uBAsD9B"}
|
|
@@ -24,9 +24,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.genTempDir = exports.isTempDir = void 0;
|
|
27
|
-
const path = __importStar(require("node:path"));
|
|
28
27
|
const genIsolatedTempInfra_1 = require("../../infra/isomorph.fs/genIsolatedTempInfra");
|
|
29
28
|
const getGitRoot_1 = require("../../infra/isomorph.fs/getGitRoot");
|
|
29
|
+
const path = __importStar(require("node:path"));
|
|
30
30
|
const genEphemeralTempDir_1 = require("./genEphemeralTempDir");
|
|
31
31
|
const pruneStale_1 = require("./pruneStale");
|
|
32
32
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genTempDir.js","sourceRoot":"","sources":["../../../src/domain.operations/genTempDir/genTempDir.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"genTempDir.js","sourceRoot":"","sources":["../../../src/domain.operations/genTempDir/genTempDir.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sFAAmF;AACnF,kEAA+D;AAE/D,gDAAkC;AAClC,+DAA4D;AAC5D,6CAA8C;AAE9C;;;GAGG;AACH,MAAM,gBAAgB,GACpB,iEAAiE,CAAC;AAEpE;;;;;;;;GAQG;AACI,MAAM,SAAS,GAAG,CAAC,KAAuB,EAAW,EAAE;IAC5D,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1C,OAAO,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACxC,CAAC,CAAC;AAHW,QAAA,SAAS,aAGpB;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACI,MAAM,UAAU,GAAG,CAAC,KAc1B,EAAU,EAAE;IACX,eAAe;IACf,MAAM,OAAO,GAAG,IAAA,uBAAU,GAAE,CAAC;IAE7B,6CAA6C;IAC7C,MAAM,SAAS,GAAG,IAAA,2CAAoB,EAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IAEpD,kDAAkD;IAClD,KAAK,IAAA,2BAAc,EAAC,EAAE,MAAM,EAAE,SAAS,CAAC,YAAY,EAAE,CAAC,CAAC;IAExD,kCAAkC;IAClC,MAAM,OAAO,GAAG,IAAA,yCAAmB,EAAC;QAClC,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,SAAS,EAAE,EAAE,YAAY,EAAE,SAAS,CAAC,YAAY,EAAE;QACnD,OAAO;KACR,CAAC,CAAC;IAEH,qCAAqC;IACrC,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC,CAAC;AApCW,QAAA,UAAU,cAoCrB"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SlowtestReporterJest = void 0;
|
|
4
|
-
const buildBlockHierarchy_1 = require("
|
|
5
|
-
const emitJsonReport_1 = require("
|
|
6
|
-
const formatTerminalReport_1 = require("
|
|
7
|
-
const evaluateThreshold_1 = require("
|
|
4
|
+
const buildBlockHierarchy_1 = require("../../../domain.operations/slowtestReporter/hierarchy/buildBlockHierarchy");
|
|
5
|
+
const emitJsonReport_1 = require("../../../domain.operations/slowtestReporter/output/emitJsonReport");
|
|
6
|
+
const formatTerminalReport_1 = require("../../../domain.operations/slowtestReporter/output/formatTerminalReport");
|
|
7
|
+
const evaluateThreshold_1 = require("../../../domain.operations/slowtestReporter/threshold/evaluateThreshold");
|
|
8
8
|
/**
|
|
9
9
|
* .what = jest reporter implementation for slowtest
|
|
10
10
|
* .why = collects test time via jest reporter lifecycle hooks
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlowtestReporterJest.js","sourceRoot":"","sources":["../../../../src/domain.operations/slowtestReporter/reporter/SlowtestReporterJest.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"SlowtestReporterJest.js","sourceRoot":"","sources":["../../../../src/domain.operations/slowtestReporter/reporter/SlowtestReporterJest.ts"],"names":[],"mappings":";;;AAeA,+GAG+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AAC,KAAK;SAClB,CAAC;QAEF,uBAAuB;QACvB,MAAM,cAAc,GAAG,IAAA,2CAAoB,EAAC;YAC1C,MAAM;YACN,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAE5B,iCAAiC;QACjC,MAAM,IAAA,+BAAc,EAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IACxD,CAAC;IAED;;;OAGG;IACH,YAAY;QACV,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AA5HD,oDA4HC;AAED,0GAA0G;AAC1G,kBAAe,oBAAoB,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SlowtestReporterVitest = void 0;
|
|
4
|
-
const buildBlockHierarchy_1 = require("
|
|
5
|
-
const emitJsonReport_1 = require("
|
|
6
|
-
const formatTerminalReport_1 = require("
|
|
7
|
-
const evaluateThreshold_1 = require("
|
|
4
|
+
const buildBlockHierarchy_1 = require("../../../domain.operations/slowtestReporter/hierarchy/buildBlockHierarchy");
|
|
5
|
+
const emitJsonReport_1 = require("../../../domain.operations/slowtestReporter/output/emitJsonReport");
|
|
6
|
+
const formatTerminalReport_1 = require("../../../domain.operations/slowtestReporter/output/formatTerminalReport");
|
|
7
|
+
const evaluateThreshold_1 = require("../../../domain.operations/slowtestReporter/threshold/evaluateThreshold");
|
|
8
8
|
/**
|
|
9
9
|
* .what = extract ancestor titles from test's fullName
|
|
10
10
|
* .why = vitest provides fullName with " > " separator, need to split into ancestors
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlowtestReporterVitest.js","sourceRoot":"","sources":["../../../../src/domain.operations/slowtestReporter/reporter/SlowtestReporterVitest.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Slowtest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,OAAO,EAAE;gBACP,KAAK,EAAE,aAAa;gBACpB,KAAK,EAAE,KAAK,CAAC,MAAM;gBACnB,IAAI,EAAE,SAAS;aAChB;YACD,KAAK;SACN,CAAC;QAEF,uBAAuB;QACvB,MAAM,cAAc,GAAG,IAAA,2CAAoB,EAAC;YAC1C,MAAM;YACN,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAE5B,iCAAiC;QACjC,MAAM,IAAA,+BAAc,EAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IACxD,CAAC;CACF;AAjID,wDAiIC"}
|
|
@@ -1,10 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* .what = result of findsertSymlink operation
|
|
3
|
+
* .why = observability into which code path was taken for tests and debug
|
|
4
|
+
*/
|
|
5
|
+
export interface FindsertSymlinkResult {
|
|
6
|
+
/** whether the symlink was created or already found */
|
|
7
|
+
effect: 'created' | 'found';
|
|
8
|
+
/** race condition that was overcome, if any */
|
|
9
|
+
overcame: 'EEXIST' | 'ENOENT' | null;
|
|
10
|
+
}
|
|
1
11
|
/**
|
|
2
12
|
* .what = creates a symlink if absent, no-op if correct symlink exists
|
|
3
13
|
* .why = idempotent symlink creation safe for parallel workers
|
|
4
14
|
*
|
|
15
|
+
* .note = handles three race scenarios:
|
|
16
|
+
* 1. EEXIST: another worker created symlink → verify target, return if correct
|
|
17
|
+
* 2. ENOENT on verify: another worker deleted symlink → retry
|
|
18
|
+
* 3. stale symlink/file: remove and create
|
|
19
|
+
*
|
|
5
20
|
* @throws UnexpectedCodePathError if path exists but is not the expected symlink
|
|
6
21
|
*/
|
|
7
22
|
export declare const findsertSymlink: (input: {
|
|
8
23
|
target: string;
|
|
9
24
|
path: string;
|
|
10
|
-
}) =>
|
|
25
|
+
}) => FindsertSymlinkResult;
|
|
@@ -31,50 +31,78 @@ const isSymlinkEexistError_1 = require("./isSymlinkEexistError");
|
|
|
31
31
|
* .what = creates a symlink if absent, no-op if correct symlink exists
|
|
32
32
|
* .why = idempotent symlink creation safe for parallel workers
|
|
33
33
|
*
|
|
34
|
+
* .note = handles three race scenarios:
|
|
35
|
+
* 1. EEXIST: another worker created symlink → verify target, return if correct
|
|
36
|
+
* 2. ENOENT on verify: another worker deleted symlink → retry
|
|
37
|
+
* 3. stale symlink/file: remove and create
|
|
38
|
+
*
|
|
34
39
|
* @throws UnexpectedCodePathError if path exists but is not the expected symlink
|
|
35
40
|
*/
|
|
36
41
|
const findsertSymlink = (input) => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
const MAX_RETRIES = 3;
|
|
43
|
+
for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {
|
|
44
|
+
// check if correct symlink already exists
|
|
45
|
+
const stat = (() => {
|
|
46
|
+
try {
|
|
47
|
+
return fs.lstatSync(input.path);
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
})();
|
|
53
|
+
if (stat?.isSymbolicLink()) {
|
|
54
|
+
try {
|
|
55
|
+
const currentTarget = fs.readlinkSync(input.path);
|
|
56
|
+
if (currentTarget === input.target) {
|
|
57
|
+
return { effect: 'found', overcame: null }; // correct symlink exists
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
// symlink deleted between lstat and readlink — retry
|
|
62
|
+
const code = error.code;
|
|
63
|
+
if (code === 'ENOENT')
|
|
64
|
+
continue;
|
|
65
|
+
throw error;
|
|
66
|
+
}
|
|
41
67
|
}
|
|
42
|
-
|
|
43
|
-
|
|
68
|
+
// remove stale symlink, directory, or file
|
|
69
|
+
if (stat) {
|
|
70
|
+
fs.rmSync(input.path, { recursive: true, force: true });
|
|
44
71
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return; // correct symlink exists
|
|
72
|
+
// create symlink
|
|
73
|
+
try {
|
|
74
|
+
fs.symlinkSync(input.target, input.path);
|
|
75
|
+
return { effect: 'created', overcame: null }; // success
|
|
50
76
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
77
|
+
catch (error) {
|
|
78
|
+
// handle race: another worker created symlink between our check and create
|
|
79
|
+
if (!(0, isSymlinkEexistError_1.isSymlinkEexistError)(error))
|
|
80
|
+
throw error;
|
|
81
|
+
// another worker created symlink — verify it's correct
|
|
82
|
+
try {
|
|
83
|
+
const raceStat = fs.lstatSync(input.path);
|
|
84
|
+
if (raceStat.isSymbolicLink()) {
|
|
85
|
+
const currentTarget = fs.readlinkSync(input.path);
|
|
86
|
+
if (currentTarget === input.target) {
|
|
87
|
+
return { effect: 'found', overcame: 'EEXIST' }; // correct symlink created by another worker
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
throw new helpful_errors_1.UnexpectedCodePathError('symlink exists but points to unexpected target', {
|
|
91
|
+
target: input.target,
|
|
92
|
+
path: input.path,
|
|
93
|
+
isSymlink: raceStat.isSymbolicLink(),
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
catch (verifyError) {
|
|
97
|
+
// symlink deleted between EEXIST and verify — retry
|
|
98
|
+
const code = verifyError.code;
|
|
99
|
+
if (code === 'ENOENT')
|
|
100
|
+
continue;
|
|
101
|
+
throw verifyError;
|
|
70
102
|
}
|
|
71
103
|
}
|
|
72
|
-
throw new helpful_errors_1.UnexpectedCodePathError('symlink exists but points to unexpected target', {
|
|
73
|
-
target: input.target,
|
|
74
|
-
path: input.path,
|
|
75
|
-
isSymlink: raceStat.isSymbolicLink(),
|
|
76
|
-
});
|
|
77
104
|
}
|
|
105
|
+
throw new helpful_errors_1.UnexpectedCodePathError('findsertSymlink exceeded max retries due to concurrent deletes', { target: input.target, path: input.path, maxRetries: MAX_RETRIES });
|
|
78
106
|
};
|
|
79
107
|
exports.findsertSymlink = findsertSymlink;
|
|
80
108
|
//# sourceMappingURL=findsertSymlink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findsertSymlink.js","sourceRoot":"","sources":["../../../src/infra/isomorph.fs/findsertSymlink.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAyD;AAEzD,4CAA8B;AAC9B,iEAA8D;
|
|
1
|
+
{"version":3,"file":"findsertSymlink.js","sourceRoot":"","sources":["../../../src/infra/isomorph.fs/findsertSymlink.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAyD;AAEzD,4CAA8B;AAC9B,iEAA8D;AAa9D;;;;;;;;;;GAUG;AACI,MAAM,eAAe,GAAG,CAAC,KAG/B,EAAyB,EAAE;IAC1B,MAAM,WAAW,GAAG,CAAC,CAAC;IAEtB,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,GAAG,WAAW,EAAE,OAAO,EAAE,EAAE,CAAC;QACvD,0CAA0C;QAC1C,MAAM,IAAI,GAAG,CAAC,GAAG,EAAE;YACjB,IAAI,CAAC;gBACH,OAAO,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAClC,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC,CAAC,EAAE,CAAC;QAEL,IAAI,IAAI,EAAE,cAAc,EAAE,EAAE,CAAC;YAC3B,IAAI,CAAC;gBACH,MAAM,aAAa,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAClD,IAAI,aAAa,KAAK,KAAK,CAAC,MA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gBACH,CAAC;gBAED,MAAM,IAAI,wCAAuB,CAC/B,gDAAgD,EAChD;oBACE,MAAM,EAAE,KAAK,CAAC,MAAM;oBACpB,IAAI,EAAE,KAAK,CAAC,IAAI;oBAChB,SAAS,EAAE,QAAQ,CAAC,cAAc,EAAE;iBACrC,CACF,CAAC;YACJ,CAAC;YAAC,OAAO,WAAW,EAAE,CAAC;gBACrB,oDAAoD;gBACpD,MAAM,IAAI,GAAI,WAAqC,CAAC,IAAI,CAAC;gBACzD,IAAI,IAAI,KAAK,QAAQ;oBAAE,SAAS;gBAChC,MAAM,WAAW,CAAC;YACpB,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,IAAI,wCAAuB,CAC/B,gEAAgE,EAChE,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,CACpE,CAAC;AACJ,CAAC,CAAC;AA1EW,QAAA,eAAe,mBA0E1B"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "test-fns",
|
|
3
3
|
"author": "ehmpathy",
|
|
4
4
|
"description": "write usecase driven tests systematically for simpler, safer, and more readable code",
|
|
5
|
-
"version": "1.15.
|
|
5
|
+
"version": "1.15.6",
|
|
6
6
|
"repository": "ehmpathy/test-fns",
|
|
7
7
|
"homepage": "https://github.com/ehmpathy/test-fns",
|
|
8
8
|
"keywords": [
|
|
@@ -30,14 +30,18 @@
|
|
|
30
30
|
],
|
|
31
31
|
"scripts": {
|
|
32
32
|
"commit:with-cli": "npx cz",
|
|
33
|
-
"fix:format:biome": "biome check --write
|
|
33
|
+
"fix:format:biome": "biome check --write",
|
|
34
34
|
"fix:format": "npm run fix:format:biome",
|
|
35
|
-
"fix:lint": "biome check --write
|
|
35
|
+
"fix:lint": "biome check --write",
|
|
36
36
|
"fix": "npm run fix:format && npm run fix:lint",
|
|
37
37
|
"build:artifact": "echo 'no artifact'",
|
|
38
|
-
"build:clean": "
|
|
39
|
-
"build:
|
|
38
|
+
"build:clean:bun": "rm -f ./bin/*.bc",
|
|
39
|
+
"build:clean:tsc": "(chmod -R u+w dist 2>/dev/null || true) && rm -rf dist/",
|
|
40
|
+
"build:clean": "npm run build:clean:tsc && npm run build:clean:bun",
|
|
41
|
+
"build:compile:tsc": "tsc -p ./tsconfig.build.json && tsc-alias -p ./tsconfig.build.json",
|
|
42
|
+
"build:compile": "npm run build:compile:tsc && npm run build:compile:bun --if-present",
|
|
40
43
|
"build": "npm run build:clean && npm run build:compile && npm run build:complete --if-present",
|
|
44
|
+
"test:auth": "[ \"$ECHO\" = 'true' ] && echo '. .agent/repo=.this/role=any/skills/use.apikeys.sh' || . .agent/repo=.this/role=any/skills/use.apikeys.sh",
|
|
41
45
|
"test:commits": "LAST_TAG=$(git describe --tags --abbrev=0 @^ 2> /dev/null || git rev-list --max-parents=0 HEAD) && npx commitlint --from $LAST_TAG --to HEAD --verbose",
|
|
42
46
|
"test:types": "tsc -p ./tsconfig.json --noEmit",
|
|
43
47
|
"test:format:biome": "biome format",
|
|
@@ -57,15 +61,16 @@
|
|
|
57
61
|
"test:acceptance:vitest": "vitest run --config ./vitest.acceptance.config.ts --passWithNoTests",
|
|
58
62
|
"test:acceptance:vitest:locally": "npm run build && LOCALLY=true npm run test:acceptance:vitest",
|
|
59
63
|
"test:acceptance:locally": "npm run test:acceptance:jest:locally && npm run test:acceptance:vitest:locally",
|
|
64
|
+
"test": "eval $(ECHO=true npm run --silent test:auth) && npm run test:commits && npm run test:types && npm run test:format && npm run test:lint && npm run test:unit && npm run test:integration && npm run test:acceptance:locally",
|
|
60
65
|
"test:acceptance": "npm run test:acceptance:locally",
|
|
61
|
-
"test": "npm run test:commits && npm run test:types && npm run test:format && npm run test:lint && npm run test:unit && npm run test:integration && npm run test:acceptance:locally",
|
|
62
66
|
"prepush": "npm run test && npm run build",
|
|
63
67
|
"prepublish": "npm run build",
|
|
64
68
|
"preversion": "npm run prepush",
|
|
65
69
|
"postversion": "git push origin HEAD --tags --no-verify",
|
|
66
70
|
"prepare:husky": "husky install && chmod ug+x .husky/*",
|
|
67
|
-
"prepare:rhachet": "rhachet init
|
|
68
|
-
"prepare": "if [ -e .git ] && [ -z $CI ]; then npm run prepare:husky && npm run prepare:rhachet; fi"
|
|
71
|
+
"prepare:rhachet": "rhachet init --hooks --roles mechanic behaver driver reviewer librarian ergonomist architect",
|
|
72
|
+
"prepare": "if [ -e .git ] && [ -z $CI ]; then npm run prepare:husky && npm run prepare:rhachet; fi",
|
|
73
|
+
"upgrade:rhachet": "rhachet upgrade"
|
|
69
74
|
},
|
|
70
75
|
"dependencies": {
|
|
71
76
|
"domain-objects": "0.31.9",
|
|
@@ -86,19 +91,19 @@
|
|
|
86
91
|
"@types/node": "22.15.21",
|
|
87
92
|
"@types/uuid": "10.0.0",
|
|
88
93
|
"cz-conventional-changelog": "3.3.0",
|
|
89
|
-
"declapract": "0.13.
|
|
90
|
-
"declapract-typescript-ehmpathy": "0.47.
|
|
94
|
+
"declapract": "0.13.15",
|
|
95
|
+
"declapract-typescript-ehmpathy": "0.47.45",
|
|
91
96
|
"declastruct": "1.7.3",
|
|
92
97
|
"declastruct-github": "1.3.0",
|
|
93
98
|
"depcheck": "1.4.3",
|
|
94
99
|
"esbuild-register": "3.6.0",
|
|
95
100
|
"husky": "8.0.3",
|
|
96
101
|
"jest": "30.2.0",
|
|
97
|
-
"rhachet": "1.
|
|
102
|
+
"rhachet": "1.37.15",
|
|
98
103
|
"rhachet-brains-anthropic": "0.3.3",
|
|
99
|
-
"rhachet-roles-bhrain": "0.
|
|
100
|
-
"rhachet-roles-bhuild": "0.
|
|
101
|
-
"rhachet-roles-ehmpathy": "1.
|
|
104
|
+
"rhachet-roles-bhrain": "0.19.0",
|
|
105
|
+
"rhachet-roles-bhuild": "0.14.1",
|
|
106
|
+
"rhachet-roles-ehmpathy": "1.27.13",
|
|
102
107
|
"tsc-alias": "1.8.10",
|
|
103
108
|
"tsx": "4.21.0",
|
|
104
109
|
"typescript": "5.4.5",
|