@ontrails/testing 1.0.0-beta.13 → 1.0.0-beta.15
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/.turbo/turbo-lint.log +1 -1
- package/CHANGELOG.md +28 -0
- package/README.md +11 -11
- package/dist/all.d.ts +10 -5
- package/dist/all.d.ts.map +1 -1
- package/dist/all.js +78 -26
- package/dist/all.js.map +1 -1
- package/dist/assertions.d.ts +23 -0
- package/dist/assertions.d.ts.map +1 -1
- package/dist/assertions.js +154 -0
- package/dist/assertions.js.map +1 -1
- package/dist/context.d.ts +17 -16
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +31 -20
- package/dist/context.js.map +1 -1
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +9 -5
- package/dist/contracts.js.map +1 -1
- package/dist/crosses.d.ts +4 -4
- package/dist/crosses.d.ts.map +1 -1
- package/dist/crosses.js +49 -39
- package/dist/crosses.js.map +1 -1
- package/dist/detours.d.ts +5 -4
- package/dist/detours.d.ts.map +1 -1
- package/dist/detours.js +93 -14
- package/dist/detours.js.map +1 -1
- package/dist/effective-examples.d.ts +30 -0
- package/dist/effective-examples.d.ts.map +1 -0
- package/dist/effective-examples.js +227 -0
- package/dist/effective-examples.js.map +1 -0
- package/dist/examples.d.ts +1 -1
- package/dist/examples.d.ts.map +1 -1
- package/dist/examples.js +79 -41
- package/dist/examples.js.map +1 -1
- package/dist/harness-cli.d.ts +3 -3
- package/dist/harness-cli.d.ts.map +1 -1
- package/dist/harness-cli.js +25 -33
- package/dist/harness-cli.js.map +1 -1
- package/dist/harness-mcp.d.ts +3 -3
- package/dist/harness-mcp.d.ts.map +1 -1
- package/dist/harness-mcp.js +9 -8
- package/dist/harness-mcp.js.map +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/scenario.d.ts +37 -0
- package/dist/scenario.d.ts.map +1 -0
- package/dist/scenario.js +235 -0
- package/dist/scenario.js.map +1 -0
- package/dist/types.d.ts +38 -5
- package/dist/types.d.ts.map +1 -1
- package/package.json +9 -5
- package/src/__tests__/all.test.ts +217 -29
- package/src/__tests__/context.test.ts +32 -12
- package/src/__tests__/contracts.test.ts +72 -18
- package/src/__tests__/crosses.test.ts +78 -78
- package/src/__tests__/detours.test.ts +176 -19
- package/src/__tests__/effective-examples.test.ts +203 -0
- package/src/__tests__/examples.test.ts +152 -50
- package/src/__tests__/harness-cli.test.ts +90 -0
- package/src/__tests__/harness-mcp.test.ts +37 -0
- package/src/__tests__/partial-match.test.ts +126 -0
- package/src/__tests__/scenario.test.ts +381 -0
- package/src/all.ts +149 -12
- package/src/assertions.ts +253 -0
- package/src/context.ts +64 -38
- package/src/contracts.ts +14 -8
- package/src/crosses.ts +93 -51
- package/src/detours.ts +155 -18
- package/src/effective-examples.ts +350 -0
- package/src/examples.ts +127 -59
- package/src/harness-cli.ts +33 -49
- package/src/harness-mcp.ts +9 -8
- package/src/index.ts +13 -3
- package/src/scenario.ts +370 -0
- package/src/types.ts +63 -5
- package/tsconfig.tests.json +10 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/follows.d.ts +0 -38
- package/dist/follows.d.ts.map +0 -1
- package/dist/follows.js +0 -212
- package/dist/follows.js.map +0 -1
package/.turbo/turbo-lint.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @ontrails/testing
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.15
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f511a3a: Rename `app` field to `graph` in `CliHarnessOptions` and `McpHarnessOptions`
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [4ad6b25]
|
|
12
|
+
- @ontrails/core@1.0.0-beta.15
|
|
13
|
+
- @ontrails/cli@1.0.0-beta.15
|
|
14
|
+
- @ontrails/logging@1.0.0-beta.15
|
|
15
|
+
- @ontrails/mcp@1.0.0-beta.15
|
|
16
|
+
|
|
17
|
+
## 1.0.0-beta.14
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- 69057e9: Add hierarchical CLI command trees and structured input, enforce established-only topo exports across trailheads, move developer topo and tracker state onto shared `trails.db` with pins and maintenance flows, and ship schema-derived stores through `@ontrails/store` and its Drizzle runtime.
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [69057e9]
|
|
26
|
+
- @ontrails/cli@1.0.0-beta.14
|
|
27
|
+
- @ontrails/core@1.0.0-beta.14
|
|
28
|
+
- @ontrails/logging@1.0.0-beta.14
|
|
29
|
+
- @ontrails/mcp@1.0.0-beta.14
|
|
30
|
+
|
|
3
31
|
## 1.0.0-beta.13
|
|
4
32
|
|
|
5
33
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# @ontrails/testing
|
|
2
2
|
|
|
3
|
-
Contract-driven testing for Trails. Add examples to your trails, then `testAll(
|
|
3
|
+
Contract-driven testing for Trails. Add examples to your trails, then `testAll(graph)` runs them as assertions, validates output schemas, checks composition graphs, and verifies structural integrity. One line of test code, full governance.
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
7
|
```typescript
|
|
8
8
|
import { testAll } from '@ontrails/testing';
|
|
9
|
-
import {
|
|
9
|
+
import { graph } from '../app';
|
|
10
10
|
|
|
11
|
-
testAll(
|
|
11
|
+
testAll(graph);
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
That single call covers example execution, contract validation, detour checks, and topo validation. For most apps, this is all you need.
|
|
@@ -18,9 +18,9 @@ If you want finer control:
|
|
|
18
18
|
```typescript
|
|
19
19
|
import { testExamples, testContracts, testDetours } from '@ontrails/testing';
|
|
20
20
|
|
|
21
|
-
testExamples(
|
|
22
|
-
testContracts(
|
|
23
|
-
testDetours(
|
|
21
|
+
testExamples(graph); // Run every trail's examples as tests
|
|
22
|
+
testContracts(graph); // Validate outputs against declared schemas
|
|
23
|
+
testDetours(graph); // Validate detour constructor, recover, and ordering semantics
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
## API
|
|
@@ -31,7 +31,7 @@ testDetours(app); // Verify detour targets exist
|
|
|
31
31
|
| `testExamples(topo, ctx?)` | Run trail examples as `describe`/`test` blocks |
|
|
32
32
|
| `testTrail(trail, scenarios)` | Custom scenarios for edge cases, error paths, and cross chains |
|
|
33
33
|
| `testContracts(topo, ctx?)` | Validate output against declared schemas |
|
|
34
|
-
| `testDetours(topo)` |
|
|
34
|
+
| `testDetours(topo)` | Validate detour constructor, recover, and shadowing semantics |
|
|
35
35
|
| `createCrossContext(options?)` | Mock `CrossFn` for testing composite trails; returns preconfigured `Result` values keyed by trail ID |
|
|
36
36
|
| `createTestContext(options?)` | `TrailContext` with sensible test defaults |
|
|
37
37
|
| `createTestLogger()` | Logger that captures entries in memory for assertions |
|
|
@@ -81,23 +81,23 @@ const cross = createCrossContext({
|
|
|
81
81
|
},
|
|
82
82
|
});
|
|
83
83
|
const ctx = { ...createTestContext(), cross };
|
|
84
|
-
const result = await onboardTrail.
|
|
84
|
+
const result = await onboardTrail.blaze({ name: 'Delta', type: 'tool' }, ctx);
|
|
85
85
|
```
|
|
86
86
|
|
|
87
87
|
Calls to unregistered trail IDs return `Result.err` with a descriptive message, so missing stubs fail loudly.
|
|
88
88
|
|
|
89
|
-
##
|
|
89
|
+
## Surface Harnesses
|
|
90
90
|
|
|
91
91
|
```typescript
|
|
92
92
|
import { createCliHarness, createMcpHarness } from '@ontrails/testing';
|
|
93
93
|
|
|
94
94
|
// CLI
|
|
95
|
-
const cli = createCliHarness({
|
|
95
|
+
const cli = createCliHarness({ graph });
|
|
96
96
|
const result = await cli.run('entity show --name Alpha --output json');
|
|
97
97
|
expect(result.exitCode).toBe(0);
|
|
98
98
|
|
|
99
99
|
// MCP
|
|
100
|
-
const mcp = createMcpHarness({
|
|
100
|
+
const mcp = createMcpHarness({ graph });
|
|
101
101
|
const tool = await mcp.callTool('myapp_entity_show', { name: 'Alpha' });
|
|
102
102
|
expect(tool.isError).toBe(false);
|
|
103
103
|
```
|
package/dist/all.d.ts
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
* testAll — single-line governance suite for any Topo.
|
|
3
3
|
*
|
|
4
4
|
* Wraps topo validation, example execution, contract checks, and detour
|
|
5
|
-
*
|
|
5
|
+
* contract validation into one describe block.
|
|
6
6
|
*/
|
|
7
7
|
import type { Topo, TrailContext } from '@ontrails/core';
|
|
8
8
|
import type { TestExecutionOptions } from './context.js';
|
|
9
|
+
import type { TestAllEstablishedOptions } from './types.js';
|
|
9
10
|
/**
|
|
10
11
|
* Run the full governance test suite for a Topo.
|
|
11
12
|
*
|
|
@@ -13,7 +14,7 @@ import type { TestExecutionOptions } from './context.js';
|
|
|
13
14
|
* - Structural validation via `validateTopo`
|
|
14
15
|
* - Example execution via `testExamples`
|
|
15
16
|
* - Output contract checks via `testContracts`
|
|
16
|
-
* - Detour
|
|
17
|
+
* - Detour contract validation via `testDetours`
|
|
17
18
|
*
|
|
18
19
|
* Accepts either a static context or a factory function that produces a
|
|
19
20
|
* fresh context per test (useful when the context contains mutable state
|
|
@@ -22,10 +23,14 @@ import type { TestExecutionOptions } from './context.js';
|
|
|
22
23
|
* @example
|
|
23
24
|
* ```ts
|
|
24
25
|
* import { testAll } from '@ontrails/testing';
|
|
25
|
-
* import {
|
|
26
|
+
* import { graph } from '../src/app.js';
|
|
26
27
|
*
|
|
27
|
-
* testAll(
|
|
28
|
+
* testAll(graph);
|
|
28
29
|
* ```
|
|
29
30
|
*/
|
|
30
|
-
|
|
31
|
+
type TestAllInput = Partial<TrailContext> | TestExecutionOptions | (() => Partial<TrailContext> | TestExecutionOptions);
|
|
32
|
+
export declare const testAll: (topo: Topo, ctxOrFactory?: TestAllInput) => void;
|
|
33
|
+
type EstablishedInput = Partial<TrailContext> | TestAllEstablishedOptions | (() => Partial<TrailContext> | TestAllEstablishedOptions);
|
|
34
|
+
export declare const testAllEstablished: (topo: Topo, optionsOrFactory?: EstablishedInput) => void;
|
|
35
|
+
export {};
|
|
31
36
|
//# sourceMappingURL=all.d.ts.map
|
package/dist/all.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all.d.ts","sourceRoot":"","sources":["../src/all.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"all.d.ts","sourceRoot":"","sources":["../src/all.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAMzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAGzD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,KAAK,YAAY,GACb,OAAO,CAAC,YAAY,CAAC,GACrB,oBAAoB,GACpB,CAAC,MAAM,OAAO,CAAC,YAAY,CAAC,GAAG,oBAAoB,CAAC,CAAC;AAkDzD,eAAO,MAAM,OAAO,GAAI,MAAM,IAAI,EAAE,eAAe,YAAY,KAAG,IAEjE,CAAC;AAEF,KAAK,gBAAgB,GACjB,OAAO,CAAC,YAAY,CAAC,GACrB,yBAAyB,GACzB,CAAC,MAAM,OAAO,CAAC,YAAY,CAAC,GAAG,yBAAyB,CAAC,CAAC;AA+E9D,eAAO,MAAM,kBAAkB,GAC7B,MAAM,IAAI,EACV,mBAAmB,gBAAgB,KAClC,IAYF,CAAC"}
|
package/dist/all.js
CHANGED
|
@@ -2,39 +2,37 @@
|
|
|
2
2
|
* testAll — single-line governance suite for any Topo.
|
|
3
3
|
*
|
|
4
4
|
* Wraps topo validation, example execution, contract checks, and detour
|
|
5
|
-
*
|
|
5
|
+
* contract validation into one describe block.
|
|
6
6
|
*/
|
|
7
7
|
import { describe, expect, test } from 'bun:test';
|
|
8
|
-
import { validateTopo } from '@ontrails/core';
|
|
8
|
+
import { validateEstablishedTopo, validateTopo } from '@ontrails/core';
|
|
9
|
+
import { createCliHarness } from './harness-cli.js';
|
|
10
|
+
import { createMcpHarness } from './harness-mcp.js';
|
|
9
11
|
import { testContracts } from './contracts.js';
|
|
10
12
|
import { testDetours } from './detours.js';
|
|
11
13
|
import { testExamples } from './examples.js';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
export const testAll = (topo, ctxOrFactory) => {
|
|
14
|
+
const formatValidationFailure = (error) => {
|
|
15
|
+
const issues = error.context?.issues;
|
|
16
|
+
if (issues === undefined || issues.length === 0) {
|
|
17
|
+
return error.message;
|
|
18
|
+
}
|
|
19
|
+
const details = issues.map((issue) => {
|
|
20
|
+
const id = typeof issue['id'] === 'string' ? issue['id'] : undefined;
|
|
21
|
+
const message = typeof issue['message'] === 'string' ? issue['message'] : undefined;
|
|
22
|
+
const rule = typeof issue['rule'] === 'string' ? issue['rule'] : undefined;
|
|
23
|
+
return [rule, id, message].filter(Boolean).join(': ');
|
|
24
|
+
});
|
|
25
|
+
return [error.message, ...details].join('\n');
|
|
26
|
+
};
|
|
27
|
+
const assertValidTopo = (result) => {
|
|
28
|
+
if (result.isErr()) {
|
|
29
|
+
throw new Error(formatValidationFailure(result.error));
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const registerGovernanceSuite = (topo, ctxOrFactory, validate) => {
|
|
34
33
|
describe('governance', () => {
|
|
35
34
|
test('topo validates', () => {
|
|
36
|
-
|
|
37
|
-
expect(result.isOk()).toBe(true);
|
|
35
|
+
expect(() => assertValidTopo(validate(topo))).not.toThrow();
|
|
38
36
|
});
|
|
39
37
|
// oxlint-disable-next-line jest/require-hook -- these generate describe/test blocks, not setup code
|
|
40
38
|
testExamples(topo, ctxOrFactory);
|
|
@@ -44,4 +42,58 @@ export const testAll = (topo, ctxOrFactory) => {
|
|
|
44
42
|
testDetours(topo);
|
|
45
43
|
});
|
|
46
44
|
};
|
|
45
|
+
export const testAll = (topo, ctxOrFactory) => {
|
|
46
|
+
registerGovernanceSuite(topo, ctxOrFactory, validateTopo);
|
|
47
|
+
};
|
|
48
|
+
const isEstablishedOptions = (input) => input !== undefined &&
|
|
49
|
+
(Object.hasOwn(input, 'cli') ||
|
|
50
|
+
Object.hasOwn(input, 'createPermit') ||
|
|
51
|
+
Object.hasOwn(input, 'ctx') ||
|
|
52
|
+
Object.hasOwn(input, 'mcp') ||
|
|
53
|
+
Object.hasOwn(input, 'resources') ||
|
|
54
|
+
Object.hasOwn(input, 'strictPermits'));
|
|
55
|
+
const normalizeEstablishedOptions = (input) => isEstablishedOptions(input) ? input : { ctx: input };
|
|
56
|
+
const toExecutionOptions = (options) => ({
|
|
57
|
+
...(options.createPermit === undefined
|
|
58
|
+
? {}
|
|
59
|
+
: { createPermit: options.createPermit }),
|
|
60
|
+
...(options.ctx === undefined ? {} : { ctx: options.ctx }),
|
|
61
|
+
...(options.resources === undefined ? {} : { resources: options.resources }),
|
|
62
|
+
...(options.strictPermits === undefined
|
|
63
|
+
? {}
|
|
64
|
+
: { strictPermits: options.strictPermits }),
|
|
65
|
+
});
|
|
66
|
+
const toCliHarnessOptions = (topo, options) => {
|
|
67
|
+
const cliOptions = {
|
|
68
|
+
graph: topo,
|
|
69
|
+
...options.cli,
|
|
70
|
+
};
|
|
71
|
+
if (options.ctx !== undefined) {
|
|
72
|
+
cliOptions.ctx = options.ctx;
|
|
73
|
+
}
|
|
74
|
+
return cliOptions;
|
|
75
|
+
};
|
|
76
|
+
const toMcpHarnessOptions = (topo, options) => ({
|
|
77
|
+
graph: topo,
|
|
78
|
+
...options.mcp,
|
|
79
|
+
});
|
|
80
|
+
const registerEstablishedSurfaceSuite = (topo, resolveInput) => {
|
|
81
|
+
describe('surfaces', () => {
|
|
82
|
+
test('CLI projection validates established topo', () => {
|
|
83
|
+
const options = normalizeEstablishedOptions(resolveInput());
|
|
84
|
+
expect(() => createCliHarness(toCliHarnessOptions(topo, options))).not.toThrow();
|
|
85
|
+
});
|
|
86
|
+
test('MCP projection validates established topo', () => {
|
|
87
|
+
const options = normalizeEstablishedOptions(resolveInput());
|
|
88
|
+
expect(() => createMcpHarness(toMcpHarnessOptions(topo, options))).not.toThrow();
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
export const testAllEstablished = (topo, optionsOrFactory) => {
|
|
93
|
+
const resolveInput = typeof optionsOrFactory === 'function'
|
|
94
|
+
? optionsOrFactory
|
|
95
|
+
: () => optionsOrFactory;
|
|
96
|
+
registerGovernanceSuite(topo, () => toExecutionOptions(normalizeEstablishedOptions(resolveInput())), validateEstablishedTopo);
|
|
97
|
+
registerEstablishedSurfaceSuite(topo, resolveInput);
|
|
98
|
+
};
|
|
47
99
|
//# sourceMappingURL=all.js.map
|
package/dist/all.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all.js","sourceRoot":"","sources":["../src/all.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAGlD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"all.js","sourceRoot":"","sources":["../src/all.ts"],"names":[],"mappings":"AAAA;;;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A2B,CAAC,YAAY,EAAE,CAAC,CAAC,EACrE,uBAAuB,CACxB,CAAC;IACF,+BAA+B,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;AACtD,CAAC,CAAC"}
|
package/dist/assertions.d.ts
CHANGED
|
@@ -32,6 +32,24 @@ export declare const expectOk: <T, E>(result: Result<T, E>) => T;
|
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
34
|
export declare const expectErr: <T, E>(result: Result<T, E>) => E;
|
|
35
|
+
export interface OkResultMatch {
|
|
36
|
+
readonly __resultMatch: 'ok';
|
|
37
|
+
readonly value?: unknown | undefined;
|
|
38
|
+
}
|
|
39
|
+
export interface ErrResultMatch {
|
|
40
|
+
readonly __resultMatch: 'err';
|
|
41
|
+
readonly error?: unknown | undefined;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Create a partial-match token for `Result.ok(...)` values nested inside
|
|
45
|
+
* arrays or objects, such as the `Result[]` returned by batch `ctx.cross()`.
|
|
46
|
+
*/
|
|
47
|
+
export declare const okResultMatch: (value?: unknown) => OkResultMatch;
|
|
48
|
+
/**
|
|
49
|
+
* Create a partial-match token for `Result.err(...)` values nested inside
|
|
50
|
+
* arrays or objects, such as mixed-success batch `ctx.cross()`.
|
|
51
|
+
*/
|
|
52
|
+
export declare const errResultMatch: (error?: unknown) => ErrResultMatch;
|
|
35
53
|
/**
|
|
36
54
|
* Assert that the result is ok and its value deep-equals the expected output.
|
|
37
55
|
*/
|
|
@@ -41,6 +59,11 @@ export declare const assertFullMatch: (result: Result<unknown, Error>, expected:
|
|
|
41
59
|
* the value parses against it.
|
|
42
60
|
*/
|
|
43
61
|
export declare const assertSchemaMatch: (result: Result<unknown, Error>, outputSchema: z.ZodType | undefined) => void;
|
|
62
|
+
/**
|
|
63
|
+
* Assert that the result is ok and its value is a superset of the expected
|
|
64
|
+
* partial output. Declared fields must match; extra fields are ignored.
|
|
65
|
+
*/
|
|
66
|
+
export declare const assertPartialMatch: (result: Result<unknown, Error>, expectedMatch: unknown) => void;
|
|
44
67
|
/**
|
|
45
68
|
* Assert that the result is an error of the specified type, with optional
|
|
46
69
|
* message substring matching.
|
package/dist/assertions.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertions.d.ts","sourceRoot":"","sources":["../src/assertions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAM7B;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,EAAE,CAAC,EAAE,QAAQ,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAG,CAGrD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,CAAC,EAAE,QAAQ,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAG,CAGtD,CAAC;AAMF;;GAEG;AACH,eAAO,MAAM,eAAe,GAC1B,QAAQ,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,EAC9B,UAAU,OAAO,KAChB,IAGF,CAAC;AAMF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAC5B,QAAQ,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,EAC9B,cAAc,CAAC,CAAC,OAAO,GAAG,SAAS,KAClC,IAUF,CAAC;AAMF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,EAC9B,eAAe,KAAK,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,KAAK,EAC9C,kBAAkB,MAAM,KACvB,IAMF,CAAC"}
|
|
1
|
+
{"version":3,"file":"assertions.d.ts","sourceRoot":"","sources":["../src/assertions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,MAAM,EA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,QAAQ,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,EAC9B,eAAe,KAAK,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,KAAK,EAC9C,kBAAkB,MAAM,KACvB,IAMF,CAAC"}
|
package/dist/assertions.js
CHANGED
|
@@ -41,6 +41,22 @@ export const expectErr = (result) => {
|
|
|
41
41
|
expect(result.isErr()).toBe(true);
|
|
42
42
|
return result.error;
|
|
43
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* Create a partial-match token for `Result.ok(...)` values nested inside
|
|
46
|
+
* arrays or objects, such as the `Result[]` returned by batch `ctx.cross()`.
|
|
47
|
+
*/
|
|
48
|
+
export const okResultMatch = (value) => ({
|
|
49
|
+
__resultMatch: 'ok',
|
|
50
|
+
value,
|
|
51
|
+
});
|
|
52
|
+
/**
|
|
53
|
+
* Create a partial-match token for `Result.err(...)` values nested inside
|
|
54
|
+
* arrays or objects, such as mixed-success batch `ctx.cross()`.
|
|
55
|
+
*/
|
|
56
|
+
export const errResultMatch = (error) => ({
|
|
57
|
+
__resultMatch: 'err',
|
|
58
|
+
error,
|
|
59
|
+
});
|
|
44
60
|
// ---------------------------------------------------------------------------
|
|
45
61
|
// Full Match
|
|
46
62
|
// ---------------------------------------------------------------------------
|
|
@@ -68,6 +84,144 @@ export const assertSchemaMatch = (result, outputSchema) => {
|
|
|
68
84
|
}
|
|
69
85
|
};
|
|
70
86
|
// ---------------------------------------------------------------------------
|
|
87
|
+
// Partial Match
|
|
88
|
+
// ---------------------------------------------------------------------------
|
|
89
|
+
/** Format a path for error messages. */
|
|
90
|
+
const formatLoc = (path) => path.length > 0 ? path.join('.') : 'root';
|
|
91
|
+
const isResultMatchToken = (value) => typeof value === 'object' &&
|
|
92
|
+
value !== null &&
|
|
93
|
+
'__resultMatch' in value &&
|
|
94
|
+
(value['__resultMatch'] === 'ok' ||
|
|
95
|
+
value['__resultMatch'] === 'err');
|
|
96
|
+
const isResultLike = (value) => typeof value === 'object' &&
|
|
97
|
+
value !== null &&
|
|
98
|
+
'isOk' in value &&
|
|
99
|
+
typeof value['isOk'] === 'function' &&
|
|
100
|
+
'isErr' in value &&
|
|
101
|
+
typeof value['isErr'] === 'function';
|
|
102
|
+
/** Find an unconsumed actual element that deep-matches the expected object. */
|
|
103
|
+
const findObjectMatch = (actual, elem, consumed, path, index) => actual.findIndex((a, idx) => {
|
|
104
|
+
if (consumed.has(idx)) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
try {
|
|
108
|
+
// oxlint-disable-next-line no-use-before-define -- mutual recursion with assertSubset
|
|
109
|
+
assertSubset(a, elem, [...path, `[${String(index)}]`]);
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
/**
|
|
117
|
+
* Assert that every element in `expected` exists in `actual` (order-independent).
|
|
118
|
+
*
|
|
119
|
+
* Tracks consumed indices so that duplicate expected elements each require a
|
|
120
|
+
* distinct actual element — `['a', 'a']` does not match `['a']`.
|
|
121
|
+
*/
|
|
122
|
+
const assertArraySubset = (actual, expected, path, loc) => {
|
|
123
|
+
const consumed = new Set();
|
|
124
|
+
for (let i = 0; i < expected.length; i += 1) {
|
|
125
|
+
const elem = expected[i];
|
|
126
|
+
const matchIndex = typeof elem === 'object' && elem !== null
|
|
127
|
+
? findObjectMatch(actual, elem, consumed, path, i)
|
|
128
|
+
: actual.findIndex((a, idx) => !consumed.has(idx) && a === elem);
|
|
129
|
+
if (matchIndex === -1) {
|
|
130
|
+
throw new Error(`at ${loc}[${String(i)}]: expected array to contain ${JSON.stringify(elem)}`);
|
|
131
|
+
}
|
|
132
|
+
consumed.add(matchIndex);
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
/** Assert that every key in `expected` exists in `actual` with a matching value. */
|
|
136
|
+
const assertObjectSubset = (actual, expected, path) => {
|
|
137
|
+
for (const key of Object.keys(expected)) {
|
|
138
|
+
if (!(key in actual)) {
|
|
139
|
+
throw new Error(`at ${[...path, key].join('.')}: key not found in actual`);
|
|
140
|
+
}
|
|
141
|
+
// oxlint-disable-next-line no-use-before-define -- mutual recursion with assertSubset
|
|
142
|
+
assertSubset(actual[key], expected[key], [...path, key]);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* Recursively assert that `actual` is a superset of `expected`.
|
|
147
|
+
*
|
|
148
|
+
* - **Scalars:** strict equality.
|
|
149
|
+
* - **Objects:** every key in `expected` must exist in `actual` with a matching
|
|
150
|
+
* value. Extra keys in `actual` are ignored.
|
|
151
|
+
* - **Arrays:** every element in `expected` must exist in `actual`
|
|
152
|
+
* (order-independent subset check).
|
|
153
|
+
* - **Nested objects:** recursive subset matching.
|
|
154
|
+
*/
|
|
155
|
+
// oxlint-disable-next-line max-statements -- recursive dispatch across four type branches
|
|
156
|
+
const assertSubset = (actual, expected, path) => {
|
|
157
|
+
const loc = formatLoc(path);
|
|
158
|
+
if (expected === null || expected === undefined) {
|
|
159
|
+
if (actual !== expected) {
|
|
160
|
+
throw new Error(`at ${loc}: expected ${String(expected)}, got ${String(actual)}`);
|
|
161
|
+
}
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
if (isResultMatchToken(expected)) {
|
|
165
|
+
// oxlint-disable-next-line no-use-before-define -- result token matching delegates back into assertSubset
|
|
166
|
+
assertResultTokenMatch(actual, expected, path);
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
if (Array.isArray(expected)) {
|
|
170
|
+
if (!Array.isArray(actual)) {
|
|
171
|
+
throw new TypeError(`at ${loc}: expected an array, got ${typeof actual}`);
|
|
172
|
+
}
|
|
173
|
+
assertArraySubset(actual, expected, path, loc);
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
if (typeof expected === 'object') {
|
|
177
|
+
if (typeof actual !== 'object' ||
|
|
178
|
+
actual === null ||
|
|
179
|
+
Array.isArray(actual)) {
|
|
180
|
+
throw new Error(`at ${loc}: expected an object, got ${typeof actual}`);
|
|
181
|
+
}
|
|
182
|
+
assertObjectSubset(actual, expected, path);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
if (actual !== expected) {
|
|
186
|
+
throw new Error(`at ${loc}: expected ${JSON.stringify(expected)}, got ${JSON.stringify(actual)}`);
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
const assertOkResultTokenMatch = (actual, expected, loc, path) => {
|
|
190
|
+
if (!actual.isOk()) {
|
|
191
|
+
throw new Error(`at ${loc}: expected Result.ok(...), got Result.err(...)`);
|
|
192
|
+
}
|
|
193
|
+
if (expected.value !== undefined) {
|
|
194
|
+
assertSubset(actual.value, expected.value, [...path, 'value']);
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
const assertErrResultTokenMatch = (actual, expected, loc, path) => {
|
|
198
|
+
if (!actual.isErr()) {
|
|
199
|
+
throw new Error(`at ${loc}: expected Result.err(...), got Result.ok(...)`);
|
|
200
|
+
}
|
|
201
|
+
if (expected.error !== undefined) {
|
|
202
|
+
assertSubset(actual.error, expected.error, [...path, 'error']);
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
const assertResultTokenMatch = (actual, expected, path) => {
|
|
206
|
+
const loc = formatLoc(path);
|
|
207
|
+
if (!isResultLike(actual)) {
|
|
208
|
+
throw new TypeError(`at ${loc}: expected a Result-like value`);
|
|
209
|
+
}
|
|
210
|
+
if (expected.__resultMatch === 'ok') {
|
|
211
|
+
assertOkResultTokenMatch(actual, expected, loc, path);
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
assertErrResultTokenMatch(actual, expected, loc, path);
|
|
215
|
+
};
|
|
216
|
+
/**
|
|
217
|
+
* Assert that the result is ok and its value is a superset of the expected
|
|
218
|
+
* partial output. Declared fields must match; extra fields are ignored.
|
|
219
|
+
*/
|
|
220
|
+
export const assertPartialMatch = (result, expectedMatch) => {
|
|
221
|
+
const value = expectOk(result);
|
|
222
|
+
assertSubset(value, expectedMatch, []);
|
|
223
|
+
};
|
|
224
|
+
// ---------------------------------------------------------------------------
|
|
71
225
|
// Error Match
|
|
72
226
|
// ---------------------------------------------------------------------------
|
|
73
227
|
/**
|
package/dist/assertions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertions.js","sourceRoot":"","sources":["../src/assertions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjD,8EAA8E;AAC9E,2BAA2B;AAC3B,8EAA8E;AAE9E;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAO,MAAoB,EAAK,EAAE;IACxD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjC,OAAQ,MAAkC,CAAC,KAAK,CAAC;AACnD,CAAC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAO,MAAoB,EAAK,EAAE;IACzD,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClC,OAAQ,MAAkC,CAAC,KAAK,CAAC;AACnD,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"assertions.js","sourceRoot":"","sources":["../src/assertions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjD,8EAA8E;AAC9E,2BAA2B;AAC3B,8EAA8E;AAE9E;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAO,MAAoB,EAAK,EAAE;IACxD,MAAM,CAAC,MAAM,CAAC,IA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AC,cAAc,CAAC,aAAa,CAAC,CAAC;IAC5C,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;QAClC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;IACnD,CAAC;AACH,CAAC,CAAC"}
|
package/dist/context.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Test context factory for creating TrailContext instances suitable for testing.
|
|
3
3
|
*/
|
|
4
|
-
import type { CrossFn,
|
|
5
|
-
import { Result } from '@ontrails/core';
|
|
4
|
+
import type { CrossFn, ResourceOverrideMap, Topo, TrailContext } from '@ontrails/core';
|
|
5
|
+
import { Result, buildCrossValidationSchema } from '@ontrails/core';
|
|
6
6
|
import type { TestTrailContextOptions } from './types.js';
|
|
7
7
|
/**
|
|
8
8
|
* Create a TrailContext with deterministic, test-friendly defaults.
|
|
@@ -15,34 +15,34 @@ export declare const createTestContext: (overrides?: TestTrailContextOptions) =>
|
|
|
15
15
|
export interface CreateCrossContextOptions {
|
|
16
16
|
readonly responses?: Record<string, Result<unknown, Error>> | undefined;
|
|
17
17
|
}
|
|
18
|
-
/** Minimal permit shape returned by the
|
|
19
|
-
export interface
|
|
18
|
+
/** Minimal permit shape returned by the create function. */
|
|
19
|
+
export interface MinimalPermit {
|
|
20
20
|
readonly id: string;
|
|
21
21
|
readonly scopes: readonly string[];
|
|
22
22
|
}
|
|
23
|
-
/** Trail shape consumed by the
|
|
24
|
-
export interface
|
|
23
|
+
/** Trail shape consumed by the create function — avoids importing permits. */
|
|
24
|
+
export interface PermittedTrail {
|
|
25
25
|
readonly permit?: {
|
|
26
26
|
readonly scopes: readonly string[];
|
|
27
27
|
} | 'public' | undefined;
|
|
28
28
|
}
|
|
29
29
|
export interface TestExecutionOptions {
|
|
30
30
|
readonly ctx?: Partial<TrailContext> | undefined;
|
|
31
|
-
readonly
|
|
31
|
+
readonly resources?: ResourceOverrideMap | undefined;
|
|
32
32
|
/**
|
|
33
|
-
* When true, disables automatic permit
|
|
33
|
+
* When true, disables automatic permit creation. Tests must provide
|
|
34
34
|
* explicit permits.
|
|
35
35
|
*/
|
|
36
36
|
readonly strictPermits?: boolean | undefined;
|
|
37
37
|
/**
|
|
38
|
-
* Optional function to
|
|
38
|
+
* Optional function to create a test permit for a trail. When provided,
|
|
39
39
|
* called for each trail with a non-public `permit` requirement.
|
|
40
|
-
* Returning `undefined` skips
|
|
40
|
+
* Returning `undefined` skips creation for that trail.
|
|
41
41
|
*
|
|
42
42
|
* A default inline implementation is used when this is not provided,
|
|
43
43
|
* keeping the testing package free of a hard dependency on `@ontrails/permits`.
|
|
44
44
|
*/
|
|
45
|
-
readonly
|
|
45
|
+
readonly createPermit?: (trail: PermittedTrail) => MinimalPermit | undefined;
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
48
|
* Create a mock `CrossFn` for testing composite trails.
|
|
@@ -60,16 +60,17 @@ export interface TestExecutionOptions {
|
|
|
60
60
|
*/
|
|
61
61
|
export declare const createCrossContext: (options?: CreateCrossContextOptions) => CrossFn;
|
|
62
62
|
/**
|
|
63
|
-
* Default permit
|
|
63
|
+
* Default permit creator — reads `trail.permit.scopes` and produces a
|
|
64
64
|
* minimal permit object. No dependency on `@ontrails/permits`.
|
|
65
65
|
*/
|
|
66
|
-
export declare const
|
|
66
|
+
export declare const defaultCreatePermit: (trail: PermittedTrail) => MinimalPermit | undefined;
|
|
67
67
|
export declare const normalizeTestExecutionOptions: (input?: Partial<TrailContext> | TestExecutionOptions) => TestExecutionOptions;
|
|
68
|
-
export declare const
|
|
69
|
-
export declare const
|
|
68
|
+
export declare const mergeResourceOverrides: (autoResolved: ResourceOverrideMap, ctx: Partial<TrailContext> | undefined, explicit: ResourceOverrideMap | undefined) => ResourceOverrideMap;
|
|
69
|
+
export declare const createMockResources: (app: Topo) => Promise<ResourceOverrideMap>;
|
|
70
|
+
export { buildCrossValidationSchema };
|
|
70
71
|
/**
|
|
71
72
|
* Merge a Partial<TrailContext> into a test context.
|
|
72
73
|
* Used internally when the public API accepts Partial<TrailContext>.
|
|
73
74
|
*/
|
|
74
|
-
export declare const mergeTestContext: (ctx?: Partial<TrailContext>,
|
|
75
|
+
export declare const mergeTestContext: (ctx?: Partial<TrailContext>, resources?: ResourceOverrideMap) => TrailContext;
|
|
75
76
|
//# sourceMappingURL=context.d.ts.map
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,OAAO,EACP,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,OAAO,EACP,mBAAmB,EACnB,IAAI,EACJ,YAAY,EACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,MAAM,EACN,0BAA0B,EAG3B,MAAM,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAU1D;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAC5B,YAAY,uBAAuB,KAClC,YAeF,CAAC;AAMF,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,GAAG,SAAS,CAAC;CACzE;AAED,4DAA4D;AAC5D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAED,8EAA8E;AAC9E,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,CAAC,EACZ;QAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,GACtC,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