@overkill-dev/engine 0.0.31 → 0.0.33
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/compare/serialized-value.d.ts +1 -1
- package/compare/serialized-value.d.ts.map +1 -1
- package/compare/serialized-value.js +3 -3
- package/compare/serialized-value.js.map +1 -1
- package/engine/assertion-recorder.js +12 -3
- package/engine/assertion-recorder.js.map +1 -1
- package/engine/async-control.d.ts +33 -0
- package/engine/async-control.d.ts.map +1 -0
- package/engine/async-control.js +153 -0
- package/engine/async-control.js.map +1 -0
- package/engine/async-leak-diagnostics.d.ts +20 -0
- package/engine/async-leak-diagnostics.d.ts.map +1 -0
- package/engine/async-leak-diagnostics.js +157 -0
- package/engine/async-leak-diagnostics.js.map +1 -0
- package/engine/case-execution.d.ts +1 -1
- package/engine/case-execution.d.ts.map +1 -1
- package/engine/case-execution.js +127 -65
- package/engine/case-execution.js.map +1 -1
- package/engine/engine.d.ts +2 -1
- package/engine/engine.d.ts.map +1 -1
- package/engine/engine.js +3 -4
- package/engine/engine.js.map +1 -1
- package/engine/execution-async-leak-policy.d.ts +24 -0
- package/engine/execution-async-leak-policy.d.ts.map +1 -0
- package/engine/execution-async-leak-policy.js +56 -0
- package/engine/execution-async-leak-policy.js.map +1 -0
- package/engine/execution-options.d.ts +26 -0
- package/engine/execution-options.d.ts.map +1 -0
- package/engine/execution-options.js +25 -0
- package/engine/execution-options.js.map +1 -0
- package/engine/execution-resource-tracked-cases.js +35 -0
- package/engine/execution-resource-tracked-cases.js.map +1 -0
- package/engine/execution-result.js +16 -0
- package/engine/execution-result.js.map +1 -1
- package/engine/execution-supervision.js +2 -2
- package/engine/execution-supervision.js.map +1 -1
- package/engine/execution.d.ts +7 -20
- package/engine/execution.d.ts.map +1 -1
- package/engine/execution.js +49 -85
- package/engine/execution.js.map +1 -1
- package/engine/node-assertion-error.js +47 -0
- package/engine/node-assertion-error.js.map +1 -0
- package/engine/run-result.d.ts +19 -1
- package/engine/run-result.d.ts.map +1 -1
- package/engine/run-result.js.map +1 -1
- package/engine/test-body-resource-attachment.d.ts +30 -6
- package/engine/test-body-resource-attachment.d.ts.map +1 -1
- package/engine/test-body-resource-attachment.js +81 -5
- package/engine/test-body-resource-attachment.js.map +1 -1
- package/engine/test-node.d.ts +28 -1
- package/engine/test-node.d.ts.map +1 -1
- package/engine/test-node.js +24 -2
- package/engine/test-node.js.map +1 -1
- package/engine/test-plan.d.ts +2 -0
- package/engine/test-plan.d.ts.map +1 -1
- package/engine/test-plan.js +10 -1
- package/engine/test-plan.js.map +1 -1
- package/engine/test-scope-lifecycle.js +63 -0
- package/engine/test-scope-lifecycle.js.map +1 -0
- package/engine/throwing-test-scope.js +27 -0
- package/engine/throwing-test-scope.js.map +1 -0
- package/package.json +4 -2
- package/packages/engine/engine.entry-point.d.ts +6 -4
- package/packages/engine/engine.entry-point.d.ts.map +1 -1
- package/packages/engine/engine.entry-point.js +12 -4
- package/packages/engine/engine.entry-point.js.map +1 -1
- package/readme.md +33 -3
- package/sbom.cdx.json +4 -4
package/readme.md
CHANGED
|
@@ -5,6 +5,7 @@ Core Overkill primitives for defining executable test values and running an alre
|
|
|
5
5
|
Top-level API:
|
|
6
6
|
|
|
7
7
|
- `createTestCase(options)`
|
|
8
|
+
- `createThrowingTestCase(options)`
|
|
8
9
|
- `createSkippedTestCase(options)`
|
|
9
10
|
- `createRoot(options)`
|
|
10
11
|
- `createSuite(options)`
|
|
@@ -22,7 +23,7 @@ Top-level API:
|
|
|
22
23
|
- `CaseId`, `TestId`, `TestRoot`, `TestPlan`, `ExecuteOptions`, `NonEmptyReadonlyArray`, `DeepComparable`
|
|
23
24
|
- `Reporter`, `DefinedReporter`, `ReporterEvent`, `RealTimeReporter`, `FinalResultReporter`, `RunFacts`, `SinkDeclaration`, `OutputLineIntent`, `OutputRenderer`, `DefinedOutputRenderer`, `ReportingContext`
|
|
24
25
|
- `RunResult`, `TestOutcome`, `PassOutcome`, `FailOutcome`, `SkipOutcome`, `InconclusiveOutcome`
|
|
25
|
-
- `AssertionNode`, `AssertionResult`, `AssertAssertionFacade`, `TestScopeAssertContext`
|
|
26
|
+
- `AssertionNode`, `AssertionResult`, `AssertAssertionFacade`, `InFlightTask`, `TestScopeAssertContext`
|
|
26
27
|
- `ThrownMatcher`, `ErrorMatcher`, `ExactThrownMatcher`
|
|
27
28
|
- `RequireAssertionFacade`, `FailedCheck`, `TestFailure`, `RunnerError`
|
|
28
29
|
- `Diff`, `DiffPathSegment`, `SerializedValue`, `SerializationBudget`
|
|
@@ -36,7 +37,14 @@ The top-level constructors share one default engine instance. Use
|
|
|
36
37
|
Direct execution:
|
|
37
38
|
|
|
38
39
|
```ts
|
|
39
|
-
import {
|
|
40
|
+
import {
|
|
41
|
+
createRoot,
|
|
42
|
+
createSkippedTestCase,
|
|
43
|
+
createTestCase,
|
|
44
|
+
createThrowingTestCase,
|
|
45
|
+
createTestPlan,
|
|
46
|
+
execute
|
|
47
|
+
} from '@overkill-dev/engine';
|
|
40
48
|
|
|
41
49
|
export const testNode = createTestCase({
|
|
42
50
|
body(scope) {
|
|
@@ -56,8 +64,18 @@ const skippedNode = createSkippedTestCase({
|
|
|
56
64
|
title: 'platform-specific'
|
|
57
65
|
});
|
|
58
66
|
|
|
67
|
+
const throwingNode = createThrowingTestCase({
|
|
68
|
+
body(scope) {
|
|
69
|
+
scope.assert.equal(1, 1);
|
|
70
|
+
},
|
|
71
|
+
annotations: {},
|
|
72
|
+
controls: {},
|
|
73
|
+
definitionLocations: [ { kind: 'unknown' } ],
|
|
74
|
+
title: 'legacy assertion'
|
|
75
|
+
});
|
|
76
|
+
|
|
59
77
|
const root = createRoot({
|
|
60
|
-
children: [ testNode, skippedNode ],
|
|
78
|
+
children: [ testNode, throwingNode, skippedNode ],
|
|
61
79
|
annotations: {},
|
|
62
80
|
controls: {},
|
|
63
81
|
title: 'direct'
|
|
@@ -104,6 +122,18 @@ during test construction or collection. `TestPlanCase.annotations` and
|
|
|
104
122
|
`TestPlanCase.controls` contain the resolved data after root, suite, table,
|
|
105
123
|
and case propagation.
|
|
106
124
|
|
|
125
|
+
Test scope lifecycle:
|
|
126
|
+
|
|
127
|
+
- `scope.signal` is aborted after the body returns or throws and before
|
|
128
|
+
cleanup callbacks run.
|
|
129
|
+
- `scope.cleanup(callback)` registers teardown callbacks. Callbacks run in
|
|
130
|
+
reverse registration order and may be async.
|
|
131
|
+
- `scope.drainMicrotasks()`, `scope.yieldToNextTurn()`, and
|
|
132
|
+
`scope.settleAsyncWork()` replace ad-hoc queue waits in test bodies.
|
|
133
|
+
- `scope.startInFlight(operation)` starts background Promise work now and
|
|
134
|
+
returns a handle with `wait()` and `rejects(...)`. The task must settle and
|
|
135
|
+
be observed before the test ends.
|
|
136
|
+
|
|
107
137
|
Reporter lifecycle:
|
|
108
138
|
|
|
109
139
|
- `RealTimeReporter` receives `ReporterEvent` values while a run executes.
|
package/sbom.cdx.json
CHANGED
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"component": {
|
|
17
17
|
"type": "library",
|
|
18
18
|
"name": "@overkill-dev/engine",
|
|
19
|
-
"version": "0.0.
|
|
20
|
-
"bom-ref": "pkg:npm/@overkill-dev/engine@0.0.
|
|
21
|
-
"purl": "pkg:npm/@overkill-dev/engine@0.0.
|
|
19
|
+
"version": "0.0.33",
|
|
20
|
+
"bom-ref": "pkg:npm/@overkill-dev/engine@0.0.33",
|
|
21
|
+
"purl": "pkg:npm/@overkill-dev/engine@0.0.33"
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"components": [
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"ref": "pkg:npm/@enormora/wall-clock@0.0.3"
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
|
-
"ref": "pkg:npm/@overkill-dev/engine@0.0.
|
|
57
|
+
"ref": "pkg:npm/@overkill-dev/engine@0.0.33",
|
|
58
58
|
"dependsOn": [
|
|
59
59
|
"pkg:npm/@enormora/wall-clock@0.0.3",
|
|
60
60
|
"pkg:npm/diff@9.0.0"
|