@overkill-dev/engine 0.0.1 → 0.0.3
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/LICENSE +21 -0
- package/assertion-protocol/assertion-evaluation.d.ts +13 -0
- package/assertion-protocol/assertion-evaluation.d.ts.map +1 -0
- package/assertion-protocol/assertion-evaluation.js +6 -0
- package/assertion-protocol/assertion-evaluation.js.map +1 -0
- package/assertion-protocol/assertion-node-shape.d.ts +71 -0
- package/assertion-protocol/assertion-node-shape.d.ts.map +1 -0
- package/assertion-protocol/assertion-node.d.ts +97 -0
- package/assertion-protocol/assertion-node.d.ts.map +1 -0
- package/assertion-protocol/assertion-node.js +33 -0
- package/assertion-protocol/assertion-node.js.map +1 -0
- package/assertion-protocol/assertion-reference.d.ts +73 -0
- package/assertion-protocol/assertion-reference.d.ts.map +1 -0
- package/assertion-protocol/assertion-reference.js +49 -0
- package/assertion-protocol/assertion-reference.js.map +1 -0
- package/assertion-protocol/assertions/boolean.d.ts +11 -0
- package/assertion-protocol/assertions/boolean.d.ts.map +1 -0
- package/assertion-protocol/assertions/boolean.js +12 -0
- package/assertion-protocol/assertions/boolean.js.map +1 -0
- package/assertion-protocol/assertions/collection.d.ts +22 -0
- package/assertion-protocol/assertions/collection.d.ts.map +1 -0
- package/assertion-protocol/assertions/collection.js +21 -0
- package/assertion-protocol/assertions/collection.js.map +1 -0
- package/assertion-protocol/assertions/dispatch.d.ts +88 -0
- package/assertion-protocol/assertions/dispatch.d.ts.map +1 -0
- package/assertion-protocol/assertions/dispatch.js +47 -0
- package/assertion-protocol/assertions/dispatch.js.map +1 -0
- package/assertion-protocol/assertions/equality.d.ts +17 -0
- package/assertion-protocol/assertions/equality.d.ts.map +1 -0
- package/assertion-protocol/assertions/equality.js +24 -0
- package/assertion-protocol/assertions/equality.js.map +1 -0
- package/assertion-protocol/assertions/fail.d.ts +13 -0
- package/assertion-protocol/assertions/fail.d.ts.map +1 -0
- package/assertion-protocol/assertions/fail.js +8 -0
- package/assertion-protocol/assertions/fail.js.map +1 -0
- package/assertion-protocol/assertions/numeric.d.ts +29 -0
- package/assertion-protocol/assertions/numeric.d.ts.map +1 -0
- package/assertion-protocol/assertions/numeric.js +43 -0
- package/assertion-protocol/assertions/numeric.js.map +1 -0
- package/assertion-protocol/assertions/partial.d.ts +14 -0
- package/assertion-protocol/assertions/partial.d.ts.map +1 -0
- package/assertion-protocol/assertions/partial.js +17 -0
- package/assertion-protocol/assertions/partial.js.map +1 -0
- package/assertion-protocol/assertions/presence.d.ts +17 -0
- package/assertion-protocol/assertions/presence.d.ts.map +1 -0
- package/assertion-protocol/assertions/presence.js +20 -0
- package/assertion-protocol/assertions/presence.js.map +1 -0
- package/assertion-protocol/assertions/string.d.ts +28 -0
- package/assertion-protocol/assertions/string.d.ts.map +1 -0
- package/assertion-protocol/assertions/string.js +33 -0
- package/assertion-protocol/assertions/string.js.map +1 -0
- package/assertion-protocol/assertions/type-shape.d.ts +42 -0
- package/assertion-protocol/assertions/type-shape.d.ts.map +1 -0
- package/assertion-protocol/assertions/type-shape.js +43 -0
- package/assertion-protocol/assertions/type-shape.js.map +1 -0
- package/assertion-protocol/collection-count.d.ts +6 -0
- package/assertion-protocol/collection-count.d.ts.map +1 -0
- package/assertion-protocol/collection-count.js +42 -0
- package/assertion-protocol/collection-count.js.map +1 -0
- package/assertion-protocol/evaluation.d.ts +32 -0
- package/assertion-protocol/evaluation.d.ts.map +1 -0
- package/assertion-protocol/evaluation.js +170 -0
- package/assertion-protocol/evaluation.js.map +1 -0
- package/assertion-protocol/partial-matching.d.ts +4 -0
- package/assertion-protocol/partial-matching.d.ts.map +1 -0
- package/assertion-protocol/partial-matching.js +13 -0
- package/assertion-protocol/partial-matching.js.map +1 -0
- package/assertion-protocol/source-location.d.ts +6 -0
- package/assertion-protocol/source-location.d.ts.map +1 -0
- package/assertion-protocol/source-location.js +76 -0
- package/assertion-protocol/source-location.js.map +1 -0
- package/assertion-protocol/thrown-error-record.d.ts +8 -0
- package/assertion-protocol/thrown-error-record.d.ts.map +1 -0
- package/assertion-protocol/thrown-error-record.js +17 -0
- package/assertion-protocol/thrown-error-record.js.map +1 -0
- package/assertion-protocol/thrown-matcher.d.ts +51 -0
- package/assertion-protocol/thrown-matcher.d.ts.map +1 -0
- package/assertion-protocol/thrown-matcher.js +201 -0
- package/assertion-protocol/thrown-matcher.js.map +1 -0
- package/compare/comparison-result.d.ts +25 -0
- package/compare/comparison-result.d.ts.map +1 -0
- package/compare/comparison-result.js +47 -0
- package/compare/comparison-result.js.map +1 -0
- package/compare/comparison-state.d.ts +7 -0
- package/compare/comparison-state.d.ts.map +1 -0
- package/compare/comparison-state.js +20 -0
- package/compare/comparison-state.js.map +1 -0
- package/compare/comparison.d.ts +12 -0
- package/compare/comparison.d.ts.map +1 -0
- package/compare/comparison.js +78 -0
- package/compare/comparison.js.map +1 -0
- package/compare/diff-path.d.ts +8 -0
- package/compare/diff-path.d.ts.map +1 -0
- package/compare/diff-path.js +37 -0
- package/compare/diff-path.js.map +1 -0
- package/compare/raw-comparison.d.ts +24 -0
- package/compare/raw-comparison.d.ts.map +1 -0
- package/compare/raw-comparison.js +285 -0
- package/compare/raw-comparison.js.map +1 -0
- package/compare/serialized-value-classification.d.ts +12 -0
- package/compare/serialized-value-classification.d.ts.map +1 -0
- package/compare/serialized-value-classification.js +99 -0
- package/compare/serialized-value-classification.js.map +1 -0
- package/compare/serialized-value-shape.d.ts +143 -0
- package/compare/serialized-value-shape.d.ts.map +1 -0
- package/compare/serialized-value-shape.js +12 -0
- package/compare/serialized-value-shape.js.map +1 -0
- package/compare/serialized-value-state.d.ts +12 -0
- package/compare/serialized-value-state.d.ts.map +1 -0
- package/compare/serialized-value-state.js +55 -0
- package/compare/serialized-value-state.js.map +1 -0
- package/compare/serialized-value.d.ts +11 -0
- package/compare/serialized-value.d.ts.map +1 -0
- package/compare/serialized-value.js +389 -0
- package/compare/serialized-value.js.map +1 -0
- package/compare/structured-diff.d.ts +4 -0
- package/compare/structured-diff.d.ts.map +1 -0
- package/compare/structured-diff.js +382 -0
- package/compare/structured-diff.js.map +1 -0
- package/compare/value-classification.d.ts +26 -0
- package/compare/value-classification.d.ts.map +1 -0
- package/compare/value-classification.js +112 -0
- package/compare/value-classification.js.map +1 -0
- package/diff/binary-diff.d.ts +4 -0
- package/diff/binary-diff.d.ts.map +1 -0
- package/diff/binary-diff.js +49 -0
- package/diff/binary-diff.js.map +1 -0
- package/diff/diff-shape.d.ts +117 -0
- package/diff/diff-shape.d.ts.map +1 -0
- package/diff/string-diff.d.ts +3 -0
- package/diff/string-diff.d.ts.map +1 -0
- package/diff/string-diff.js +22 -0
- package/diff/string-diff.js.map +1 -0
- package/engine/assertion-facade.d.ts +50 -0
- package/engine/assertion-facade.d.ts.map +1 -0
- package/engine/assertion-facade.js +361 -0
- package/engine/assertion-facade.js.map +1 -0
- package/engine/case-execution.d.ts +10 -0
- package/engine/case-execution.d.ts.map +1 -0
- package/engine/case-execution.js +408 -0
- package/engine/case-execution.js.map +1 -0
- package/engine/custom-assertion-recording.d.ts +33 -0
- package/engine/custom-assertion-recording.d.ts.map +1 -0
- package/engine/custom-assertion-recording.js +175 -0
- package/engine/custom-assertion-recording.js.map +1 -0
- package/engine/engine.d.ts +24 -0
- package/engine/engine.d.ts.map +1 -0
- package/engine/engine.js +33 -0
- package/engine/engine.js.map +1 -0
- package/engine/execution.d.ts +16 -0
- package/engine/execution.d.ts.map +1 -0
- package/engine/execution.js +223 -0
- package/engine/execution.js.map +1 -0
- package/engine/identity.d.ts +12 -0
- package/engine/identity.d.ts.map +1 -0
- package/engine/identity.js +20 -0
- package/engine/identity.js.map +1 -0
- package/engine/reporter.d.ts +103 -0
- package/engine/reporter.d.ts.map +1 -0
- package/engine/reporter.js +177 -0
- package/engine/reporter.js.map +1 -0
- package/engine/require-assertion-facade.d.ts +21 -0
- package/engine/require-assertion-facade.d.ts.map +1 -0
- package/engine/require-assertion-facade.js +127 -0
- package/engine/require-assertion-facade.js.map +1 -0
- package/engine/run-if-main.d.ts +20 -0
- package/engine/run-if-main.d.ts.map +1 -0
- package/engine/run-if-main.js +30 -0
- package/engine/run-if-main.js.map +1 -0
- package/engine/run-result.d.ts +110 -0
- package/engine/run-result.d.ts.map +1 -0
- package/engine/run-result.js +13 -0
- package/engine/run-result.js.map +1 -0
- package/engine/test-node.d.ts +88 -0
- package/engine/test-node.d.ts.map +1 -0
- package/engine/test-node.js +103 -0
- package/engine/test-node.js.map +1 -0
- package/engine/test-plan.d.ts +20 -0
- package/engine/test-plan.d.ts.map +1 -0
- package/engine/test-plan.js +115 -0
- package/engine/test-plan.js.map +1 -0
- package/package.json +78 -6
- package/packages/engine/assertion-protocol.entry-point.d.ts +9 -0
- package/packages/engine/assertion-protocol.entry-point.d.ts.map +1 -0
- package/packages/engine/assertion-protocol.entry-point.js +4 -0
- package/packages/engine/assertion-protocol.entry-point.js.map +1 -0
- package/packages/engine/engine.entry-point.d.ts +39 -0
- package/packages/engine/engine.entry-point.d.ts.map +1 -0
- package/packages/engine/engine.entry-point.js +47 -0
- package/packages/engine/engine.entry-point.js.map +1 -0
- package/readme.md +121 -5
- package/sbom.cdx.json +67 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { caseIdentityKey, createCaseId, formatCaseId } from "./identity.js";
|
|
2
|
+
import { ensureOwnedTestNode, mergeMetadata } from "./test-node.js";
|
|
3
|
+
function collectTestCase(testCase, suitePath, metadata) {
|
|
4
|
+
const resolvedMetadata = mergeMetadata(metadata, testCase.metadata);
|
|
5
|
+
return {
|
|
6
|
+
cases: [
|
|
7
|
+
{
|
|
8
|
+
body: testCase.body,
|
|
9
|
+
id: createCaseId(suitePath, testCase.name, null),
|
|
10
|
+
metadata: resolvedMetadata,
|
|
11
|
+
suitePath
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
reachedNodes: [testCase]
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function collectTable(table, suitePath, metadata) {
|
|
18
|
+
if (table.cases.length === 0) {
|
|
19
|
+
throw new TypeError(`Table must contain at least one case: ${[...suitePath, table.name].join(' > ')}.`);
|
|
20
|
+
}
|
|
21
|
+
const tablePath = [...suitePath, table.name];
|
|
22
|
+
const tableMetadata = mergeMetadata(metadata, table.metadata);
|
|
23
|
+
return {
|
|
24
|
+
cases: table.cases.map(function collectTableCase(tableCase) {
|
|
25
|
+
const resolvedMetadata = mergeMetadata(tableMetadata, tableCase.metadata);
|
|
26
|
+
return {
|
|
27
|
+
body: tableCase.body,
|
|
28
|
+
id: createCaseId(tablePath, tableCase.name, null),
|
|
29
|
+
metadata: resolvedMetadata,
|
|
30
|
+
suitePath: tablePath
|
|
31
|
+
};
|
|
32
|
+
}),
|
|
33
|
+
reachedNodes: [table]
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function mergeCollectedTestCases(collections) {
|
|
37
|
+
return {
|
|
38
|
+
cases: collections.flatMap(function collectCases(collection) {
|
|
39
|
+
return collection.cases;
|
|
40
|
+
}),
|
|
41
|
+
reachedNodes: collections.flatMap(function collectReachedNodes(collection) {
|
|
42
|
+
return collection.reachedNodes;
|
|
43
|
+
})
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function collectNode(node, suitePath, metadata) {
|
|
47
|
+
if (node.kind === 'test') {
|
|
48
|
+
return collectTestCase(node, suitePath, metadata);
|
|
49
|
+
}
|
|
50
|
+
if (node.kind === 'table') {
|
|
51
|
+
return collectTable(node, suitePath, metadata);
|
|
52
|
+
}
|
|
53
|
+
if (node.children.length === 0) {
|
|
54
|
+
throw new TypeError(`Suite must contain at least one child: ${[...suitePath, node.name].join(' > ')}.`);
|
|
55
|
+
}
|
|
56
|
+
const childPath = [...suitePath, node.name];
|
|
57
|
+
const childMetadata = mergeMetadata(metadata, node.metadata);
|
|
58
|
+
const children = mergeCollectedTestCases(node.children.map(function collectChild(child) {
|
|
59
|
+
return collectNode(child, childPath, childMetadata);
|
|
60
|
+
}));
|
|
61
|
+
return {
|
|
62
|
+
cases: children.cases,
|
|
63
|
+
reachedNodes: [node, ...children.reachedNodes]
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function toReachedNodeSet(reachedNodes) {
|
|
67
|
+
return new Set(reachedNodes);
|
|
68
|
+
}
|
|
69
|
+
function createOrphanedNode(node) {
|
|
70
|
+
return {
|
|
71
|
+
file: null,
|
|
72
|
+
kind: node.kind,
|
|
73
|
+
name: node.name
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function collectOrphans(constructedNodes, reachedNodes) {
|
|
77
|
+
const reachedNodeSet = toReachedNodeSet(reachedNodes);
|
|
78
|
+
return Array
|
|
79
|
+
.from(constructedNodes)
|
|
80
|
+
.filter(function isOrphan(node) {
|
|
81
|
+
return !reachedNodeSet.has(node);
|
|
82
|
+
})
|
|
83
|
+
.map(createOrphanedNode);
|
|
84
|
+
}
|
|
85
|
+
function assertUniqueCaseIds(cases) {
|
|
86
|
+
const seenCaseIds = new Set();
|
|
87
|
+
for (const testCase of cases) {
|
|
88
|
+
const key = caseIdentityKey(testCase.id);
|
|
89
|
+
if (seenCaseIds.has(key)) {
|
|
90
|
+
throw new TypeError(`Duplicate test case identity: ${formatCaseId(testCase.id)}.`);
|
|
91
|
+
}
|
|
92
|
+
seenCaseIds.add(key);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function assertNonEmptyCases(cases) {
|
|
96
|
+
if (cases.length === 0) {
|
|
97
|
+
throw new TypeError('Test plan must contain at least one executable test case.');
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
export function createTestPlanFactory(owner, constructedNodes) {
|
|
101
|
+
return function createTestPlan(root) {
|
|
102
|
+
ensureOwnedTestNode(root, owner, 'Test plan root must be an engine-created TestNode value.', 'Test plan root must be created by the same engine instance.');
|
|
103
|
+
const collection = collectNode(root, [], {});
|
|
104
|
+
const { cases: discoveredCases, reachedNodes } = collection;
|
|
105
|
+
assertNonEmptyCases(discoveredCases);
|
|
106
|
+
assertUniqueCaseIds(discoveredCases);
|
|
107
|
+
return {
|
|
108
|
+
cases: discoveredCases,
|
|
109
|
+
defined: constructedNodes.size,
|
|
110
|
+
discoveredCases,
|
|
111
|
+
orphans: collectOrphans(constructedNodes, reachedNodes)
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=test-plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-plan.js","sourceRoot":"","sources":["../../../../source/engine/test-plan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAe,MAAM,eAAe,CAAC;AAEzF,OAAO,EACH,mBAAmB,EACnB,aAAa,EAOhB,MAAM,gBAAgB,CAAC;AAyBxB,SAAS,eAAe,CACpB,QAAkB,EAClB,SAA4B,EAC5B,QAAkB;IAElB,MAAM,gBAAgB,GAAG,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAEpE,OAAO;QACH,KAAK,EAAE;YACH;gBACI,IAAI,EAAE,QAAQ,CAAC,IAAI;gBACnB,EAAE,EAAE,YAAY,CAAC,SAAS,EAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;gBAChD,QAAQ,EAAE,gBAAgB;gBAC1B,SAAS;aACZ;SACJ;QACD,YAAY,EAAE,CAAE,QAAQ,CAAE;KAC7B,CAAC;AACN,CAAC;AAED,SAAS,YAAY,CACjB,KAAY,EACZ,SAA4B,EAC5B,QAAkB;IAElB,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,SAAS,CAAC,yCAAyC,CAAE,GAAG,SAAS,EAAE,KAAK,CAAC,IAAI,CAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9G,CAAC;IAED,MAAM,SAAS,GAAG,CAAE,GAAG,SAAS,EAAE,KAA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|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
"author": "Christian Rackerseder <git@echooff.de>",
|
|
3
|
+
"bugs": {
|
|
4
|
+
"url": "https://github.com/enormora/overkill/issues"
|
|
5
|
+
},
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@enormora/wall-clock": "0.0.3",
|
|
8
|
+
"diff": "9.0.0"
|
|
9
|
+
},
|
|
10
|
+
"description": "Core Overkill engine primitives and execution model.",
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": "^26"
|
|
13
|
+
},
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"import": "./packages/engine/engine.entry-point.js",
|
|
17
|
+
"types": "./packages/engine/engine.entry-point.d.ts"
|
|
18
|
+
},
|
|
19
|
+
"./assertion-protocol/assertion-node-shape.d.ts": {
|
|
20
|
+
"types": "./assertion-protocol/assertion-node-shape.d.ts"
|
|
21
|
+
},
|
|
22
|
+
"./assertion-protocol/assertion-node.js": {
|
|
23
|
+
"import": "./assertion-protocol/assertion-node.js",
|
|
24
|
+
"types": "./assertion-protocol/assertion-node.d.ts"
|
|
25
|
+
},
|
|
26
|
+
"./assertion-protocol/assertion-reference.js": {
|
|
27
|
+
"import": "./assertion-protocol/assertion-reference.js",
|
|
28
|
+
"types": "./assertion-protocol/assertion-reference.d.ts"
|
|
29
|
+
},
|
|
30
|
+
"./assertion-protocol/thrown-error-record.js": {
|
|
31
|
+
"import": "./assertion-protocol/thrown-error-record.js",
|
|
32
|
+
"types": "./assertion-protocol/thrown-error-record.d.ts"
|
|
33
|
+
},
|
|
34
|
+
"./assertion-protocol/thrown-matcher.js": {
|
|
35
|
+
"import": "./assertion-protocol/thrown-matcher.js",
|
|
36
|
+
"types": "./assertion-protocol/thrown-matcher.d.ts"
|
|
37
|
+
},
|
|
38
|
+
"./compare/serialized-value.js": {
|
|
39
|
+
"import": "./compare/serialized-value.js",
|
|
40
|
+
"types": "./compare/serialized-value.d.ts"
|
|
41
|
+
},
|
|
42
|
+
"./engine/identity.js": {
|
|
43
|
+
"import": "./engine/identity.js",
|
|
44
|
+
"types": "./engine/identity.d.ts"
|
|
45
|
+
},
|
|
46
|
+
"./engine/reporter.js": {
|
|
47
|
+
"import": "./engine/reporter.js",
|
|
48
|
+
"types": "./engine/reporter.d.ts"
|
|
49
|
+
},
|
|
50
|
+
"./engine/run-result.js": {
|
|
51
|
+
"import": "./engine/run-result.js",
|
|
52
|
+
"types": "./engine/run-result.d.ts"
|
|
53
|
+
},
|
|
54
|
+
"./packages/engine/assertion-protocol.entry-point.js": {
|
|
55
|
+
"import": "./packages/engine/assertion-protocol.entry-point.js",
|
|
56
|
+
"types": "./packages/engine/assertion-protocol.entry-point.d.ts"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"homepage": "https://github.com/enormora/overkill#readme",
|
|
60
|
+
"keywords": [
|
|
61
|
+
"tdd",
|
|
62
|
+
"test",
|
|
63
|
+
"tests"
|
|
64
|
+
],
|
|
65
|
+
"license": "MIT",
|
|
66
|
+
"name": "@overkill-dev/engine",
|
|
67
|
+
"repository": {
|
|
68
|
+
"type": "git",
|
|
69
|
+
"url": "git+https://github.com/enormora/overkill.git"
|
|
70
|
+
},
|
|
71
|
+
"sideEffects": [
|
|
72
|
+
"./assertion-protocol/assertion-reference.js",
|
|
73
|
+
"./engine/execution.js",
|
|
74
|
+
"./engine/run-if-main.js",
|
|
75
|
+
"./packages/engine/engine.entry-point.js"
|
|
76
|
+
],
|
|
77
|
+
"type": "module",
|
|
78
|
+
"version": "0.0.3"
|
|
79
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type { AssertCompositeAssertionReturn, AssertionReference, AssertionReferenceRecord, AssertReferenceArguments, AssertReferenceReturn, CompositeAssertionGroup, CompositeAssertionReference, CompositeAssertionReferenceRecord, CompositeAssertionReturn, CompositeAssertionRunnerInput, CompositeAssertionSummaryContext, CompositeAssertionSummaryFormatter, NarrowingCompositeAssertionReference, NarrowingCompositeAssertionReferenceRecord, NarrowingCompositeAssertionSummaryFormatter } from '../../assertion-protocol/assertion-reference.ts';
|
|
2
|
+
export { createCompositeAssertionGroup, createCompositeAssertionReferenceRecord, createNarrowingCompositeAssertionReferenceRecord, getAssertionReferenceRecord, getCompositeAssertionReferenceRecord, getNarrowingAssertionReferenceRecord, isAssertionReference, isCompositeAssertionGroup, isNarrowingAssertionReference } from '../../assertion-protocol/assertion-reference.ts';
|
|
3
|
+
export type { AssertAssertionNode, BuiltInAssertAssertionNode, CompositeAssertionChildNode, CompositeAssertionNode, ForeignAssertionNode, ForeignAssertionResult, RequireAssertionNode } from '../../assertion-protocol/assertion-node.ts';
|
|
4
|
+
export type { AssertionOptions, AssertionSource, DeepComparable, FailedCheck, FailedCompositeCheck, FailedForeignCheck, FailedLeafCheck, InstanceConstructor, NonEmptyReadonlyArray, ResolvableSourceLocation, SourceLocation, SourceLocationProvider } from '../../assertion-protocol/assertion-node-shape.ts';
|
|
5
|
+
export type { ErrorMatcher, ExactThrownMatcher, SynchronousCallback, ThrownAssertionObservation, ThrownMatcher } from '../../assertion-protocol/thrown-matcher.ts';
|
|
6
|
+
export { thrownMatcherChildren } from '../../assertion-protocol/thrown-matcher.ts';
|
|
7
|
+
export type { ThrownErrorRecord } from '../../assertion-protocol/thrown-error-record.ts';
|
|
8
|
+
export { createThrownErrorRecord } from '../../assertion-protocol/thrown-error-record.ts';
|
|
9
|
+
//# sourceMappingURL=assertion-protocol.entry-point.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertion-protocol.entry-point.d.ts","sourceRoot":"","sources":["../../../../../source/packages/engine/assertion-protocol.entry-point.ts"],"names":[],"mappings":"AAAA,YAAY,EACR,8BAA8B,EAC9B,kBAAkB,EAClB,wBAAwB,EACxB,wBAAwB,EACxB,qBAAqB,EACrB,uBAAuB,EACvB,2BAA2B,EAC3B,iCAAiC,EACjC,wBAAwB,EACxB,6BAA6B,EAC7B,gCAAgC,EAChC,kCAAkC,EAClC,oCAAoC,EACpC,0CAA0C,EAC1C,2CAA2C,EAC9C,MAAM,iDAAiD,CAAC;AACzD,OAAO,EACH,6BAA6B,EAC7B,uCAAuC,EACvC,gDAAgD,EAChD,2BAA2B,EAC3B,oCAAoC,EACpC,oCAAoC,EACpC,oBAAoB,EACpB,yBAAyB,EACzB,6BAA6B,EAChC,MAAM,iDAAiD,CAAC;AACzD,YAAY,EACR,mBAAmB,EACnB,0BAA0B,EAC1B,2BAA2B,EAC3B,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACvB,MAAM,4CAA4C,CAAC;AACpD,YAAY,EACR,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,EACxB,cAAc,EACd,sBAAsB,EACzB,MAAM,kDAAkD,CAAC;AAC1D,YAAY,EACR,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,0BAA0B,EAC1B,aAAa,EAChB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACnF,YAAY,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AACzF,OAAO,EAAE,uBAAuB,EAAE,MAAM,iDAAiD,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { createCompositeAssertionGroup, createCompositeAssertionReferenceRecord, createNarrowingCompositeAssertionReferenceRecord, getAssertionReferenceRecord, getCompositeAssertionReferenceRecord, getNarrowingAssertionReferenceRecord, isAssertionReference, isCompositeAssertionGroup, isNarrowingAssertionReference } from "../../assertion-protocol/assertion-reference.js";
|
|
2
|
+
export { thrownMatcherChildren } from "../../assertion-protocol/thrown-matcher.js";
|
|
3
|
+
export { createThrownErrorRecord } from "../../assertion-protocol/thrown-error-record.js";
|
|
4
|
+
//# sourceMappingURL=assertion-protocol.entry-point.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertion-protocol.entry-point.js","sourceRoot":"","sources":["../../../../../source/packages/engine/assertion-protocol.entry-point.ts"],"names":[],"mappings":"AAiBA,OAAO,EACH,6BAA6B,EAC7B,uCAAuC,EACvC,gDAAgD,EAChD,2BAA2B,EAC3B,oCAAoC,EACpC,oCAAoC,EACpC,oBAAoB,EACpB,yBAAyB,EACzB,6BAA6B,EAChC,MAAM,iDAAiD,CAAC;AA+BzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AAEnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,iDAAiD,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type Engine } from '../../engine/engine.ts';
|
|
2
|
+
import type { RunIfMainOptions } from '../../engine/run-if-main.ts';
|
|
3
|
+
import type { SuiteOptions, TableOptions, TestCaseOptions, TestNode } from '../../engine/test-node.ts';
|
|
4
|
+
export declare function createEngine(): Engine;
|
|
5
|
+
export declare function createSuite(options: SuiteOptions): ReturnType<Engine['createSuite']>;
|
|
6
|
+
export declare function createTable(options: TableOptions): ReturnType<Engine['createTable']>;
|
|
7
|
+
export declare function createTestCase(options: TestCaseOptions): ReturnType<Engine['createTestCase']>;
|
|
8
|
+
export declare function createTestPlan(root: TestNode): ReturnType<Engine['createTestPlan']>;
|
|
9
|
+
export declare function execute(testPlan: Parameters<Engine['execute']>[0], options?: Parameters<Engine['execute']>[1]): ReturnType<Engine['execute']>;
|
|
10
|
+
export declare function runIfMain(meta: Readonly<ImportMeta>, testNode: TestNode, options?: RunIfMainOptions): Promise<void>;
|
|
11
|
+
export type { Engine } from '../../engine/engine.ts';
|
|
12
|
+
export type { Execute, ExecuteOptions } from '../../engine/execution.ts';
|
|
13
|
+
export type { RunIfMain, RunIfMainOptions } from '../../engine/run-if-main.ts';
|
|
14
|
+
export { formatCaseId } from '../../engine/identity.ts';
|
|
15
|
+
export type { CaseId, TestId } from '../../engine/identity.ts';
|
|
16
|
+
export type { DirectorySinkDeclaration, FileSinkDeclaration, FinalResultReporter, MemorySinkDeclaration, RealTimeReporter, Reporter, ReporterEvent, RunFacts, SinkDeclaration, StandardOutputSinkDeclaration, StreamSinkDeclaration } from '../../engine/reporter.ts';
|
|
17
|
+
export { validateReporterSinks } from '../../engine/reporter.ts';
|
|
18
|
+
export type { AssertAssertionFacade } from '../../engine/assertion-facade.ts';
|
|
19
|
+
export type { RequireAssertionFacade } from '../../engine/require-assertion-facade.ts';
|
|
20
|
+
export type { AssertionOptions, AssertionSource, DeepComparable, FailedCheck, FailedCompositeCheck, FailedForeignCheck, FailedLeafCheck, InstanceConstructor, NonEmptyReadonlyArray, ResolvableSourceLocation, SourceLocationProvider, SourceLocation } from '../../assertion-protocol/assertion-node-shape.ts';
|
|
21
|
+
export type { ArrayDiffOperation, ByteDiffRange, Diff, DiffPathSegment, Hunk, MapDiffOperation, ObjectDiffOperation, SetDiffOperation } from '../../diff/diff-shape.ts';
|
|
22
|
+
export { defaultSerializationBudget, serializeValue, serializeValueWithBudget } from '../../compare/serialized-value.ts';
|
|
23
|
+
export type { SerializationBudget, SerializedMapEntry, SerializedProperty, SerializedPropertyKey, SerializedValue, SerializationTruncation } from '../../compare/serialized-value.ts';
|
|
24
|
+
export { captureSourceLocation, unknownSourceLocation } from '../../assertion-protocol/source-location.ts';
|
|
25
|
+
export type { ErrorMatcher, ExactThrownMatcher, SynchronousCallback, ThrownAssertionObservation, ThrownMatcher } from '../../assertion-protocol/thrown-matcher.ts';
|
|
26
|
+
export type { FalseAssertionNode, TrueAssertionNode } from '../../assertion-protocol/assertions/boolean.ts';
|
|
27
|
+
export type { EmptinessAssertionNode, LengthAssertionNode } from '../../assertion-protocol/assertions/collection.ts';
|
|
28
|
+
export type { DeepEqualAssertionNode, EqualAssertionNode, NotDeepEqualAssertionNode, NotEqualAssertionNode } from '../../assertion-protocol/assertions/equality.ts';
|
|
29
|
+
export type { FailAssertionNode } from '../../assertion-protocol/assertions/fail.ts';
|
|
30
|
+
export type { BetweenAssertionNode, NumericComparisonAssertionNode } from '../../assertion-protocol/assertions/numeric.ts';
|
|
31
|
+
export type { ArrayContainsPartialAssertionNode, MembersPartialDeepEqualAssertionNode, PartialDeepEqualAssertionNode } from '../../assertion-protocol/assertions/partial.ts';
|
|
32
|
+
export type { DefinedAssertionNode, NotNullAssertionNode, NullAssertionNode, UndefinedAssertionNode } from '../../assertion-protocol/assertions/presence.ts';
|
|
33
|
+
export type { MatchAssertionNode, StringContainsAssertionNode } from '../../assertion-protocol/assertions/string.ts';
|
|
34
|
+
export type { HasPropertyAssertionNode, InstanceOfAssertionNode, TypeAssertionNode } from '../../assertion-protocol/assertions/type-shape.ts';
|
|
35
|
+
export type { AssertionTestFailure, BodyErrorTestFailure, FailOutcome, InconclusiveOutcome, OrphanedNode, PassOutcome, PerTestResult, RunResult, RunnerError, RunSummary, SkipOutcome, SuiteRunCounts, TestContractFailure, TestContractFailureCode, TestFailure, TestOutcome } from '../../engine/run-result.ts';
|
|
36
|
+
export type { AssertAssertionNode, AssertionNode, AssertionResult, CompositeAssertionChildNode, CompositeAssertionNode, ForeignAssertionNode, ForeignAssertionResult, RequireAssertionNode } from '../../assertion-protocol/assertion-node.ts';
|
|
37
|
+
export type { TestScopeAssertContext, Metadata, Suite, SuiteOptions, Table, TableCase, TableCaseOptions, TableOptions, TestBody, TestCase, TestCaseOptions, TestScope, TestNode } from '../../engine/test-node.ts';
|
|
38
|
+
export type { TestPlan, TestPlanCase, TestPlanCaseBody } from '../../engine/test-plan.ts';
|
|
39
|
+
//# sourceMappingURL=engine.entry-point.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine.entry-point.d.ts","sourceRoot":"","sources":["../../../../../source/packages/engine/engine.entry-point.ts"],"names":[],"mappings":"AACA,OAAO,EAAwC,KAAK,MAAM,EAAE,M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 -0,0 +1,47 @@
|
|
|
1
|
+
import { createWallClock } from '@enormora/wall-clock';
|
|
2
|
+
import { createEngine as createEngineInstance } from "../../engine/engine.js";
|
|
3
|
+
import { createExecute } from "../../engine/execution.js";
|
|
4
|
+
import { createReporterDispatcher } from "../../engine/reporter.js";
|
|
5
|
+
function readProcessExitCode() {
|
|
6
|
+
return process.exitCode;
|
|
7
|
+
}
|
|
8
|
+
function writeProcessExitCode(exitCode) {
|
|
9
|
+
process.exitCode = exitCode;
|
|
10
|
+
}
|
|
11
|
+
export function createEngine() {
|
|
12
|
+
const wallClock = createWallClock();
|
|
13
|
+
return createEngineInstance({
|
|
14
|
+
execute: createExecute({
|
|
15
|
+
reporterDispatcher: createReporterDispatcher({ wallClock }),
|
|
16
|
+
wallClock
|
|
17
|
+
}),
|
|
18
|
+
nodeVersion: process.versions.node,
|
|
19
|
+
readExitCode: readProcessExitCode,
|
|
20
|
+
wallClock,
|
|
21
|
+
writeExitCode: writeProcessExitCode
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
const defaultEngine = createEngine();
|
|
25
|
+
export function createSuite(options) {
|
|
26
|
+
return defaultEngine.createSuite(options);
|
|
27
|
+
}
|
|
28
|
+
export function createTable(options) {
|
|
29
|
+
return defaultEngine.createTable(options);
|
|
30
|
+
}
|
|
31
|
+
export function createTestCase(options) {
|
|
32
|
+
return defaultEngine.createTestCase(options);
|
|
33
|
+
}
|
|
34
|
+
export function createTestPlan(root) {
|
|
35
|
+
return defaultEngine.createTestPlan(root);
|
|
36
|
+
}
|
|
37
|
+
export async function execute(testPlan, options) {
|
|
38
|
+
return await defaultEngine.execute(testPlan, options);
|
|
39
|
+
}
|
|
40
|
+
export async function runIfMain(meta, testNode, options) {
|
|
41
|
+
await defaultEngine.runIfMain(meta, testNode, options);
|
|
42
|
+
}
|
|
43
|
+
export { formatCaseId } from "../../engine/identity.js";
|
|
44
|
+
export { validateReporterSinks } from "../../engine/reporter.js";
|
|
45
|
+
export { defaultSerializationBudget, serializeValue, serializeValueWithBudget } from "../../compare/serialized-value.js";
|
|
46
|
+
export { captureSourceLocation, unknownSourceLocation } from "../../assertion-protocol/source-location.js";
|
|
47
|
+
//# sourceMappingURL=engine.entry-point.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine.entry-point.js","sourceRoot":"","sources":["../../../../../source/packages/engine/engine.entry-point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,YAAY,IAAI,oBAAoB,EAAe,MAAM,wBAAwB,CAAC;AAC3F,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAIpE,SAAS,mBAAmB;IACxB,OAAO,OAAO,CAAC,QAAQ,CAAC;AAC5B,CAAC;AAED,SAAS,oBAAoB,CAAC,QAAgB;IAC1C,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,YAAY;IACxB,MAAM,SAAS,GAAG,eAAe,EAAE,CAAC;IAEpC,OAAO,oBAAoB,CAAC;QACxB,OAAO,EAAE,aAAa,CAAC;YACnB,kBAAkB,EAAE,wBAAwB,CAAC,EAAE,SAAS,EAAE,CAAC;YAC3D,SAAS;SACZ,CAAC;QACF,WAAW,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;QAClC,YAAY,EAAE,mBAAmB;QACjC,SAAS;QACT,aAAa,EAAE,oBAAoB;KACtC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,aAAa,GAAG,YAAY,EAAE,CAAC;AAErC,MAAM,UAAU,WAAW,CAAC,OAAqB;IAC7C,OAAO,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,OAAqB;IAC7C,OAAO,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,OAAwB;IACnD,OAAO,aAAa,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAAc;IACzC,OAAO,aAAa,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CACzB,QAA0C,EAC1C,OAA0C;IAE1C,OAAO,MAAM,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC1D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAC3B,IAA0B,EAC1B,QAAkB,EAClB,OAA0B;IAE1B,MAAM,aAAa,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC3D,CAAC;AAKD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAexD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AA2BjE,OAAO,EACH,0BAA0B,EAC1B,cAAc,EACd,wBAAwB,EAC3B,MAAM,mCAAmC,CAAC;AAS3C,OAAO,EACH,qBAAqB,EACrB,qBAAqB,EACxB,MAAM,6CAA6C,CAAC"}
|
package/readme.md
CHANGED
|
@@ -1,7 +1,123 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@overkill-dev/engine`
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
can subsequently be configured for it. It contains no real package content and is published already
|
|
5
|
-
deprecated.
|
|
3
|
+
Core Overkill primitives for defining executable test values and running an already-resolved test plan.
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
Top-level API:
|
|
6
|
+
|
|
7
|
+
- `createTestCase(options)`
|
|
8
|
+
- `createSuite(options)`
|
|
9
|
+
- `createTable(options)`
|
|
10
|
+
- `createTestPlan(root)`
|
|
11
|
+
- `execute(testPlan)`
|
|
12
|
+
- `runIfMain(import.meta, root, options?)`
|
|
13
|
+
- `createEngine()`
|
|
14
|
+
- `formatCaseId(caseId)`
|
|
15
|
+
- `validateReporterSinks(reporters)`
|
|
16
|
+
- `captureSourceLocation()`
|
|
17
|
+
- `unknownSourceLocation`
|
|
18
|
+
- `CaseId`, `TestId`, `TestPlan`, `ExecuteOptions`, `RunIfMainOptions`, `NonEmptyReadonlyArray`, `DeepComparable`
|
|
19
|
+
- `Reporter`, `ReporterEvent`, `RealTimeReporter`, `FinalResultReporter`, `RunFacts`, `SinkDeclaration`
|
|
20
|
+
- `RunResult`, `TestOutcome`, `PassOutcome`, `FailOutcome`, `SkipOutcome`, `InconclusiveOutcome`
|
|
21
|
+
- `AssertionNode`, `AssertionResult`, `AssertAssertionFacade`, `TestScopeAssertContext`
|
|
22
|
+
- `ThrownMatcher`, `ErrorMatcher`, `ExactThrownMatcher`
|
|
23
|
+
- `RequireAssertionFacade`, `FailedCheck`, `TestFailure`, `RunnerError`
|
|
24
|
+
- `Diff`, `DiffPathSegment`, `SerializedValue`, `SerializationBudget`
|
|
25
|
+
|
|
26
|
+
The top-level constructors share one default engine instance. Use
|
|
27
|
+
`createEngine()` when a collection needs isolated construction state for
|
|
28
|
+
`defined` counts and orphan detection.
|
|
29
|
+
|
|
30
|
+
Direct Node execution:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { createTestCase, runIfMain } from '@overkill-dev/engine';
|
|
34
|
+
import { createDotReporter } from '@overkill-dev/reporter-dot';
|
|
35
|
+
|
|
36
|
+
export const testNode = createTestCase({
|
|
37
|
+
body(scope) {
|
|
38
|
+
scope.assert.true(true, { message: 'passes' });
|
|
39
|
+
return scope.assert.collect();
|
|
40
|
+
},
|
|
41
|
+
metadata: {},
|
|
42
|
+
name: 'passes'
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
await runIfMain(import.meta, testNode, {
|
|
46
|
+
reporters: [ createDotReporter() ]
|
|
47
|
+
});
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Aggregate direct Node execution:
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
import { createSuite, runIfMain } from '@overkill-dev/engine';
|
|
54
|
+
import { createDotReporter } from '@overkill-dev/reporter-dot';
|
|
55
|
+
import { testNode as orders } from './orders.test.ts';
|
|
56
|
+
import { testNode as users } from './users.test.ts';
|
|
57
|
+
|
|
58
|
+
export const testNode = createSuite({
|
|
59
|
+
children: [ users, orders ],
|
|
60
|
+
metadata: {},
|
|
61
|
+
name: 'all'
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
await runIfMain(import.meta, testNode, {
|
|
65
|
+
reporters: [ createDotReporter() ]
|
|
66
|
+
});
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Reporter lifecycle:
|
|
70
|
+
|
|
71
|
+
- `RealTimeReporter` receives `ReporterEvent` values while a run executes.
|
|
72
|
+
Use it for terminal output, IDE integrations, and other live consumers.
|
|
73
|
+
- `FinalResultReporter` receives the completed `RunResult` once after the
|
|
74
|
+
run finishes. Use it for reports, archives, and machine-readable output.
|
|
75
|
+
- `dispose` is required and nullable on both reporter lifecycles. When
|
|
76
|
+
present, `execute()` calls it exactly once after the run or after reporter
|
|
77
|
+
validation fails.
|
|
78
|
+
- A reporter has one lifecycle. If a package needs both modes, expose two
|
|
79
|
+
reporters that share the same internal formatting or recording logic.
|
|
80
|
+
|
|
81
|
+
Reporter sinks:
|
|
82
|
+
|
|
83
|
+
- `stdout` and `stderr` can be `exclusive` or `shared`.
|
|
84
|
+
- `file`, `directory`, and `stream` sinks are exclusive.
|
|
85
|
+
- `memory` sinks are private to each reporter.
|
|
86
|
+
- `execute()` validates declared sink conflicts before emitting `run-start`.
|
|
87
|
+
|
|
88
|
+
Assertion bodies:
|
|
89
|
+
|
|
90
|
+
- `scope.assert.*` records non-gating assertion nodes and continues.
|
|
91
|
+
- `scope.require.*` records narrow gating assertion nodes and short-circuits
|
|
92
|
+
when one fails.
|
|
93
|
+
- Custom assertions are imported assertion reference values:
|
|
94
|
+
`scope.assert(resultOk, result)`. Narrowing references may also be used with
|
|
95
|
+
`scope.require(resultOk, result)`. Define reusable assertion references with
|
|
96
|
+
`@overkill-dev/assert`.
|
|
97
|
+
- Async custom assertions must be awaited before `scope.assert.collect()`.
|
|
98
|
+
- `scope.assert.throws(body, matcher)` checks synchronous thrown values.
|
|
99
|
+
Promise-returning callbacks belong to `scope.assert.rejects(...)`.
|
|
100
|
+
- `scope.assert.rejects(thunk, matcher)` checks promise rejections and must be
|
|
101
|
+
awaited before `scope.assert.collect()`.
|
|
102
|
+
- Thrown matchers are explicit objects. Use `{ exact: value }` for `Object.is`
|
|
103
|
+
matching, or structured error fields such as `type`, `message`, `code`,
|
|
104
|
+
`name`, and recursive `cause`. Structured error matchers require at least
|
|
105
|
+
one field, and a string `message` is exact.
|
|
106
|
+
- `scope.assert.annotated(message).*` and `scope.require.annotated(message).*`
|
|
107
|
+
record message-scoped checks without positional message overloads.
|
|
108
|
+
- `scope.assert.annotated(message)(reference, ...)` annotates a custom
|
|
109
|
+
assertion boundary.
|
|
110
|
+
- `scope.assert.collect()` is builder-mode syntax sugar. It returns the
|
|
111
|
+
non-empty assertion list for the engine to evaluate, and is not part of
|
|
112
|
+
`AssertAssertionFacade`.
|
|
113
|
+
- `scope.plan(count)` must be the first test-body call and must declare a
|
|
114
|
+
positive integer assertion count.
|
|
115
|
+
- `FailedCheck` is discriminated by `kind`. Every failed check carries
|
|
116
|
+
serialized `actual` and `expected` values, a typed mismatch `path`, and
|
|
117
|
+
`diff: Diff | null`. Leaf checks carry value comparison data, composite
|
|
118
|
+
checks carry child diagnostics, and foreign checks carry normalized
|
|
119
|
+
thrown-error data.
|
|
120
|
+
- Failed checks carry concrete source locations. Engine-created assertion
|
|
121
|
+
nodes capture lazy locations at the public assertion boundary. Direct raw
|
|
122
|
+
assertion nodes must provide `location`; use `captureSourceLocation()` for
|
|
123
|
+
accuracy or `unknownSourceLocation` when unavailable.
|
package/sbom.cdx.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json",
|
|
3
|
+
"bomFormat": "CycloneDX",
|
|
4
|
+
"specVersion": "1.6",
|
|
5
|
+
"version": 1,
|
|
6
|
+
"metadata": {
|
|
7
|
+
"tools": {
|
|
8
|
+
"components": [
|
|
9
|
+
{
|
|
10
|
+
"type": "application",
|
|
11
|
+
"name": "packtory",
|
|
12
|
+
"version": "0.0.78"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
"component": {
|
|
17
|
+
"type": "library",
|
|
18
|
+
"name": "@overkill-dev/engine",
|
|
19
|
+
"version": "0.0.3",
|
|
20
|
+
"bom-ref": "pkg:npm/@overkill-dev/engine@0.0.3",
|
|
21
|
+
"purl": "pkg:npm/@overkill-dev/engine@0.0.3"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"components": [
|
|
25
|
+
{
|
|
26
|
+
"type": "library",
|
|
27
|
+
"name": "@enormora/wall-clock",
|
|
28
|
+
"version": "0.0.3",
|
|
29
|
+
"bom-ref": "pkg:npm/@enormora/wall-clock@0.0.3",
|
|
30
|
+
"scope": "required",
|
|
31
|
+
"licenses": [
|
|
32
|
+
{
|
|
33
|
+
"expression": "MIT"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"purl": "pkg:npm/@enormora/wall-clock@0.0.3"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"type": "library",
|
|
40
|
+
"name": "diff",
|
|
41
|
+
"version": "9.0.0",
|
|
42
|
+
"bom-ref": "pkg:npm/diff@9.0.0",
|
|
43
|
+
"scope": "required",
|
|
44
|
+
"licenses": [
|
|
45
|
+
{
|
|
46
|
+
"expression": "BSD-3-Clause"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"purl": "pkg:npm/diff@9.0.0"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"dependencies": [
|
|
53
|
+
{
|
|
54
|
+
"ref": "pkg:npm/@enormora/wall-clock@0.0.3"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"ref": "pkg:npm/@overkill-dev/engine@0.0.3",
|
|
58
|
+
"dependsOn": [
|
|
59
|
+
"pkg:npm/@enormora/wall-clock@0.0.3",
|
|
60
|
+
"pkg:npm/diff@9.0.0"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"ref": "pkg:npm/diff@9.0.0"
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
}
|