@metamesh/testkit 0.17.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +199 -0
- package/README.md +121 -110
- package/dist/assertions.d.ts +8 -15
- package/dist/assertions.d.ts.map +1 -1
- package/dist/assertions.js +24 -70
- package/dist/assertions.js.map +1 -1
- package/dist/content-assertions.d.ts +28 -0
- package/dist/content-assertions.d.ts.map +1 -0
- package/dist/content-assertions.js +75 -0
- package/dist/content-assertions.js.map +1 -0
- package/dist/content-matchers.d.ts +12 -0
- package/dist/content-matchers.d.ts.map +1 -0
- package/dist/content-matchers.js +22 -0
- package/dist/content-matchers.js.map +1 -0
- package/dist/docs/guides/package.md +121 -110
- package/dist/docs/manifest.json +157 -45
- package/dist/docs/reference/font-fixtures/LoadedFontFixtures.md +1 -1
- package/dist/docs/reference/font-fixtures/loadFontFixtureServices.md +1 -1
- package/dist/docs/reference/font-fixtures/loadFontFixtures.md +1 -1
- package/dist/docs/reference/fonts/FontTestFixture.md +1 -1
- package/dist/docs/reference/fonts/prepareFontTestServices.md +1 -1
- package/dist/docs/reference/index/BufferContent.md +13 -0
- package/dist/docs/reference/index/ContentMismatchError.md +12 -0
- package/dist/docs/reference/index/GeneratorModelTestInput.md +13 -0
- package/dist/docs/reference/index/GeneratorModelTestOptions.md +10 -0
- package/dist/docs/reference/index/GeneratorTestResult.md +18 -0
- package/dist/docs/reference/index/GeneratorTestRunner.md +9 -11
- package/dist/docs/reference/index/GeneratorTestRunnerOptions.md +2 -3
- package/dist/docs/reference/index/MeshContent.md +13 -0
- package/dist/docs/reference/index/MeshMeasurementExpectation.md +3 -3
- package/dist/docs/reference/index/MeshMeasurementTolerances.md +1 -1
- package/dist/docs/reference/index/RunModelOptions.md +13 -0
- package/dist/docs/reference/index/assertEqualBuffer.md +15 -0
- package/dist/docs/reference/index/assertEqualMesh.md +14 -0
- package/dist/docs/reference/index/{expectMeshMeasurements.md → assertMeshMeasurements.md} +3 -3
- package/dist/docs/reference/index/{expectValidDefaults.md → assertValidDefaults.md} +3 -3
- package/dist/docs/reference/index/assertValidDefinition.md +10 -0
- package/dist/docs/reference/index/assertValidParts.md +12 -0
- package/dist/docs/reference/index/{expectValidPresets.md → assertValidPresets.md} +3 -3
- package/dist/docs/reference/index/contentMatchers.md +12 -0
- package/dist/docs/reference/index/createGeneratorTestRunner.md +2 -4
- package/dist/docs/reference/index/getTestEngine.md +1 -1
- package/dist/docs/reference/index/runModel.md +13 -0
- package/dist/generator-execution.d.ts +6 -0
- package/dist/generator-execution.d.ts.map +1 -0
- package/dist/generator-execution.js +20 -0
- package/dist/generator-execution.js.map +1 -0
- package/dist/generator-test-runner.d.ts +32 -0
- package/dist/generator-test-runner.d.ts.map +1 -0
- package/dist/generator-test-runner.js +109 -0
- package/dist/generator-test-runner.js.map +1 -0
- package/dist/index.d.ts +10 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/measurements.d.ts +4 -4
- package/dist/measurements.d.ts.map +1 -1
- package/dist/measurements.js +10 -9
- package/dist/measurements.js.map +1 -1
- package/dist/run-model.d.ts +21 -0
- package/dist/run-model.d.ts.map +1 -0
- package/dist/run-model.js +39 -0
- package/dist/run-model.js.map +1 -0
- package/dist/{engine.d.ts → test-engine.d.ts} +1 -1
- package/dist/test-engine.d.ts.map +1 -0
- package/dist/{engine.js → test-engine.js} +1 -1
- package/dist/test-engine.js.map +1 -0
- package/package.json +8 -5
- package/dist/docs/reference/index/GeneratorTestExecution.md +0 -19
- package/dist/docs/reference/index/ModelTestOptions.md +0 -13
- package/dist/docs/reference/index/expectSerializableDefinition.md +0 -10
- package/dist/docs/reference/index/expectValidParts.md +0 -19
- package/dist/docs/reference/index/withModel.md +0 -17
- package/dist/engine.d.ts.map +0 -1
- package/dist/engine.js.map +0 -1
- package/dist/model.d.ts +0 -17
- package/dist/model.d.ts.map +0 -1
- package/dist/model.js +0 -22
- package/dist/model.js.map +0 -1
- package/dist/runner.d.ts +0 -38
- package/dist/runner.d.ts.map +0 -1
- package/dist/runner.js +0 -130
- package/dist/runner.js.map +0 -1
- package/dist/snapshot-scope.d.ts +0 -4
- package/dist/snapshot-scope.d.ts.map +0 -1
- package/dist/snapshot-scope.js +0 -10
- package/dist/snapshot-scope.js.map +0 -1
package/dist/docs/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"formatVersion": 1,
|
|
3
3
|
"packageName": "@metamesh/testkit",
|
|
4
|
-
"packageVersion": "0.
|
|
4
|
+
"packageVersion": "0.19.0",
|
|
5
5
|
"documents": [
|
|
6
6
|
{
|
|
7
7
|
"id": "testkit/guide/testing",
|
|
@@ -88,107 +88,205 @@
|
|
|
88
88
|
]
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
|
-
"id": "testkit/reference/index/
|
|
92
|
-
"title": "
|
|
93
|
-
"summary": "
|
|
94
|
-
"path": "reference/index/
|
|
91
|
+
"id": "testkit/reference/index/assertEqualBuffer",
|
|
92
|
+
"title": "assertEqualBuffer",
|
|
93
|
+
"summary": "Asserts exact ordered numeric contents through length and at(index), without copying storage. Uses Object.is regardless of storage type: NaN equals NaN; signed zero differs. Throws ContentMismatchError for the first difference, TypeError for malformed inputs, and preserves reader failures. This assertion does not establish valid manufacturing geometry.",
|
|
94
|
+
"path": "reference/index/assertEqualBuffer.md",
|
|
95
95
|
"importPath": "@metamesh/testkit",
|
|
96
96
|
"availability": "Local Node testing",
|
|
97
97
|
"canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
|
|
98
98
|
"keywords": [
|
|
99
99
|
"reference",
|
|
100
100
|
"index",
|
|
101
|
-
"
|
|
101
|
+
"assertEqualBuffer"
|
|
102
102
|
]
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
|
-
"id": "testkit/reference/index/
|
|
106
|
-
"title": "
|
|
107
|
-
"summary": "
|
|
108
|
-
"path": "reference/index/
|
|
105
|
+
"id": "testkit/reference/index/assertEqualMesh",
|
|
106
|
+
"title": "assertEqualMesh",
|
|
107
|
+
"summary": "Asserts identical positions and indices with buffer-specific mismatch diagnostics. Ignores metadata. Geometrically equivalent meshes with different triangulation or ordering can fail. Shares assertEqualBuffer's numeric equality, validation and error behavior without copying storage.",
|
|
108
|
+
"path": "reference/index/assertEqualMesh.md",
|
|
109
109
|
"importPath": "@metamesh/testkit",
|
|
110
110
|
"availability": "Local Node testing",
|
|
111
111
|
"canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
|
|
112
112
|
"keywords": [
|
|
113
113
|
"reference",
|
|
114
114
|
"index",
|
|
115
|
-
"
|
|
115
|
+
"assertEqualMesh"
|
|
116
116
|
]
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
|
-
"id": "testkit/reference/index/
|
|
120
|
-
"title": "
|
|
121
|
-
"summary": "
|
|
122
|
-
"path": "reference/index/
|
|
119
|
+
"id": "testkit/reference/index/assertMeshMeasurements",
|
|
120
|
+
"title": "assertMeshMeasurements",
|
|
121
|
+
"summary": "Analyzes current buffers, requires closed oriented edge topology, and checks selected physical facts with explicit absolute tolerances. Returns fresh measurements without initializing an engine. These facts do not prove geometric equivalence or absence of self-intersections.",
|
|
122
|
+
"path": "reference/index/assertMeshMeasurements.md",
|
|
123
123
|
"importPath": "@metamesh/testkit",
|
|
124
124
|
"availability": "Local Node testing",
|
|
125
125
|
"canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
|
|
126
126
|
"keywords": [
|
|
127
127
|
"reference",
|
|
128
128
|
"index",
|
|
129
|
-
"
|
|
129
|
+
"assertMeshMeasurements"
|
|
130
130
|
]
|
|
131
131
|
},
|
|
132
132
|
{
|
|
133
|
-
"id": "testkit/reference/index/
|
|
134
|
-
"title": "
|
|
133
|
+
"id": "testkit/reference/index/assertValidDefaults",
|
|
134
|
+
"title": "assertValidDefaults",
|
|
135
135
|
"summary": "Throws unless defaults strictly decode and equal the defaults derived from the definition.",
|
|
136
|
-
"path": "reference/index/
|
|
136
|
+
"path": "reference/index/assertValidDefaults.md",
|
|
137
137
|
"importPath": "@metamesh/testkit",
|
|
138
138
|
"availability": "Local Node testing",
|
|
139
139
|
"canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
|
|
140
140
|
"keywords": [
|
|
141
141
|
"reference",
|
|
142
142
|
"index",
|
|
143
|
-
"
|
|
143
|
+
"assertValidDefaults"
|
|
144
144
|
]
|
|
145
145
|
},
|
|
146
146
|
{
|
|
147
|
-
"id": "testkit/reference/index/
|
|
148
|
-
"title": "
|
|
149
|
-
"summary": "
|
|
150
|
-
"path": "reference/index/
|
|
147
|
+
"id": "testkit/reference/index/assertValidDefinition",
|
|
148
|
+
"title": "assertValidDefinition",
|
|
149
|
+
"summary": "Strictly parses a definition and requires its JSON round trip to retain the canonical package representation.",
|
|
150
|
+
"path": "reference/index/assertValidDefinition.md",
|
|
151
151
|
"importPath": "@metamesh/testkit",
|
|
152
152
|
"availability": "Local Node testing",
|
|
153
153
|
"canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
|
|
154
154
|
"keywords": [
|
|
155
155
|
"reference",
|
|
156
156
|
"index",
|
|
157
|
-
"
|
|
157
|
+
"assertValidDefinition"
|
|
158
158
|
]
|
|
159
159
|
},
|
|
160
160
|
{
|
|
161
|
-
"id": "testkit/reference/index/
|
|
162
|
-
"title": "
|
|
161
|
+
"id": "testkit/reference/index/assertValidParts",
|
|
162
|
+
"title": "assertValidParts",
|
|
163
|
+
"summary": "Validates supplied world meshes and their exact agreement with reconstructed local geometry and placement. Resolves to the same parts or rejects on failure. A supplied engine is reused; otherwise the shared engine initializes lazily.",
|
|
164
|
+
"path": "reference/index/assertValidParts.md",
|
|
165
|
+
"importPath": "@metamesh/testkit",
|
|
166
|
+
"availability": "Local Node testing",
|
|
167
|
+
"canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
|
|
168
|
+
"keywords": [
|
|
169
|
+
"reference",
|
|
170
|
+
"index",
|
|
171
|
+
"assertValidParts"
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"id": "testkit/reference/index/assertValidPresets",
|
|
176
|
+
"title": "assertValidPresets",
|
|
163
177
|
"summary": "Checks preset metadata. Validate domain assertions through the generation test runner.",
|
|
164
|
-
"path": "reference/index/
|
|
178
|
+
"path": "reference/index/assertValidPresets.md",
|
|
179
|
+
"importPath": "@metamesh/testkit",
|
|
180
|
+
"availability": "Local Node testing",
|
|
181
|
+
"canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
|
|
182
|
+
"keywords": [
|
|
183
|
+
"reference",
|
|
184
|
+
"index",
|
|
185
|
+
"assertValidPresets"
|
|
186
|
+
]
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"id": "testkit/reference/index/BufferContent",
|
|
190
|
+
"title": "BufferContent",
|
|
191
|
+
"summary": "Numeric contents readable without copying their storage, including immutable model buffers.",
|
|
192
|
+
"path": "reference/index/BufferContent.md",
|
|
193
|
+
"importPath": "@metamesh/testkit",
|
|
194
|
+
"availability": "Local Node testing",
|
|
195
|
+
"canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
|
|
196
|
+
"keywords": [
|
|
197
|
+
"reference",
|
|
198
|
+
"index",
|
|
199
|
+
"BufferContent"
|
|
200
|
+
]
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"id": "testkit/reference/index/contentMatchers",
|
|
204
|
+
"title": "contentMatchers",
|
|
205
|
+
"summary": "Optional expect.extend adapters; only content mismatches become failed matcher results.",
|
|
206
|
+
"path": "reference/index/contentMatchers.md",
|
|
207
|
+
"importPath": "@metamesh/testkit",
|
|
208
|
+
"availability": "Local Node testing",
|
|
209
|
+
"canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
|
|
210
|
+
"keywords": [
|
|
211
|
+
"reference",
|
|
212
|
+
"index",
|
|
213
|
+
"contentMatchers"
|
|
214
|
+
]
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"id": "testkit/reference/index/ContentMismatchError",
|
|
218
|
+
"title": "ContentMismatchError",
|
|
219
|
+
"summary": "A difference in valid buffer contents, distinct from malformed inputs or reader failures.",
|
|
220
|
+
"path": "reference/index/ContentMismatchError.md",
|
|
221
|
+
"importPath": "@metamesh/testkit",
|
|
222
|
+
"availability": "Local Node testing",
|
|
223
|
+
"canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
|
|
224
|
+
"keywords": [
|
|
225
|
+
"reference",
|
|
226
|
+
"index",
|
|
227
|
+
"ContentMismatchError"
|
|
228
|
+
]
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"id": "testkit/reference/index/createGeneratorTestRunner",
|
|
232
|
+
"title": "createGeneratorTestRunner",
|
|
233
|
+
"summary": "Creates a lazy runner for one generation program without loading assets or an engine.",
|
|
234
|
+
"path": "reference/index/createGeneratorTestRunner.md",
|
|
235
|
+
"importPath": "@metamesh/testkit",
|
|
236
|
+
"availability": "Local Node testing",
|
|
237
|
+
"canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
|
|
238
|
+
"keywords": [
|
|
239
|
+
"reference",
|
|
240
|
+
"index",
|
|
241
|
+
"createGeneratorTestRunner"
|
|
242
|
+
]
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"id": "testkit/reference/index/GeneratorModelTestInput",
|
|
246
|
+
"title": "GeneratorModelTestInput",
|
|
247
|
+
"summary": "Definition and executable runtime needed to validate and prepare a Generator.",
|
|
248
|
+
"path": "reference/index/GeneratorModelTestInput.md",
|
|
165
249
|
"importPath": "@metamesh/testkit",
|
|
166
250
|
"availability": "Local Node testing",
|
|
167
251
|
"canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
|
|
168
252
|
"keywords": [
|
|
169
253
|
"reference",
|
|
170
254
|
"index",
|
|
171
|
-
"
|
|
255
|
+
"GeneratorModelTestInput"
|
|
172
256
|
]
|
|
173
257
|
},
|
|
174
258
|
{
|
|
175
|
-
"id": "testkit/reference/index/
|
|
176
|
-
"title": "
|
|
177
|
-
"summary": "
|
|
178
|
-
"path": "reference/index/
|
|
259
|
+
"id": "testkit/reference/index/GeneratorModelTestOptions",
|
|
260
|
+
"title": "GeneratorModelTestOptions",
|
|
261
|
+
"summary": "Generation policy, optional test-owned engine, and asynchronous Generator asset preparation.",
|
|
262
|
+
"path": "reference/index/GeneratorModelTestOptions.md",
|
|
179
263
|
"importPath": "@metamesh/testkit",
|
|
180
264
|
"availability": "Local Node testing",
|
|
181
265
|
"canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
|
|
182
266
|
"keywords": [
|
|
183
267
|
"reference",
|
|
184
268
|
"index",
|
|
185
|
-
"
|
|
269
|
+
"GeneratorModelTestOptions"
|
|
270
|
+
]
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"id": "testkit/reference/index/GeneratorTestResult",
|
|
274
|
+
"title": "GeneratorTestResult",
|
|
275
|
+
"summary": "Parameter or assertion failure, or a durable immutable model result.",
|
|
276
|
+
"path": "reference/index/GeneratorTestResult.md",
|
|
277
|
+
"importPath": "@metamesh/testkit",
|
|
278
|
+
"availability": "Local Node testing",
|
|
279
|
+
"canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
|
|
280
|
+
"keywords": [
|
|
281
|
+
"reference",
|
|
282
|
+
"index",
|
|
283
|
+
"GeneratorTestResult"
|
|
186
284
|
]
|
|
187
285
|
},
|
|
188
286
|
{
|
|
189
287
|
"id": "testkit/reference/index/GeneratorTestRunner",
|
|
190
288
|
"title": "GeneratorTestRunner",
|
|
191
|
-
"summary": "A lazy reusable Generator test session; dispose the runner
|
|
289
|
+
"summary": "A lazy reusable Generator test session; dispose only the runner's caches.",
|
|
192
290
|
"path": "reference/index/GeneratorTestRunner.md",
|
|
193
291
|
"importPath": "@metamesh/testkit",
|
|
194
292
|
"availability": "Local Node testing",
|
|
@@ -227,6 +325,20 @@
|
|
|
227
325
|
"getTestEngine"
|
|
228
326
|
]
|
|
229
327
|
},
|
|
328
|
+
{
|
|
329
|
+
"id": "testkit/reference/index/MeshContent",
|
|
330
|
+
"title": "MeshContent",
|
|
331
|
+
"summary": "Ordered manufacturing geometry; placement, appearance and resource identities are separate.",
|
|
332
|
+
"path": "reference/index/MeshContent.md",
|
|
333
|
+
"importPath": "@metamesh/testkit",
|
|
334
|
+
"availability": "Local Node testing",
|
|
335
|
+
"canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
|
|
336
|
+
"keywords": [
|
|
337
|
+
"reference",
|
|
338
|
+
"index",
|
|
339
|
+
"MeshContent"
|
|
340
|
+
]
|
|
341
|
+
},
|
|
230
342
|
{
|
|
231
343
|
"id": "testkit/reference/index/MeshMeasurementExpectation",
|
|
232
344
|
"title": "MeshMeasurementExpectation",
|
|
@@ -256,31 +368,31 @@
|
|
|
256
368
|
]
|
|
257
369
|
},
|
|
258
370
|
{
|
|
259
|
-
"id": "testkit/reference/index/
|
|
260
|
-
"title": "
|
|
261
|
-
"summary": "
|
|
262
|
-
"path": "reference/index/
|
|
371
|
+
"id": "testkit/reference/index/runModel",
|
|
372
|
+
"title": "runModel",
|
|
373
|
+
"summary": "Runs a model program or synchronous callback once and returns durable immutable data. Strictly validates Generator inputs (defaults when omitted), prepares services, and returns durable data.",
|
|
374
|
+
"path": "reference/index/runModel.md",
|
|
263
375
|
"importPath": "@metamesh/testkit",
|
|
264
376
|
"availability": "Local Node testing",
|
|
265
377
|
"canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
|
|
266
378
|
"keywords": [
|
|
267
379
|
"reference",
|
|
268
380
|
"index",
|
|
269
|
-
"
|
|
381
|
+
"runModel"
|
|
270
382
|
]
|
|
271
383
|
},
|
|
272
384
|
{
|
|
273
|
-
"id": "testkit/reference/index/
|
|
274
|
-
"title": "
|
|
275
|
-
"summary": "
|
|
276
|
-
"path": "reference/index/
|
|
385
|
+
"id": "testkit/reference/index/RunModelOptions",
|
|
386
|
+
"title": "RunModelOptions",
|
|
387
|
+
"summary": "Host policy and prepared services for an isolated model run; the engine remains host-owned.",
|
|
388
|
+
"path": "reference/index/RunModelOptions.md",
|
|
277
389
|
"importPath": "@metamesh/testkit",
|
|
278
390
|
"availability": "Local Node testing",
|
|
279
391
|
"canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
|
|
280
392
|
"keywords": [
|
|
281
393
|
"reference",
|
|
282
394
|
"index",
|
|
283
|
-
"
|
|
395
|
+
"RunModelOptions"
|
|
284
396
|
]
|
|
285
397
|
}
|
|
286
398
|
]
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Byte-verified local font selections and a reusable Generator service-preparation adapter.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/testkit/font-fixtures` (@metamesh/testkit@0.
|
|
5
|
+
Import from `@metamesh/testkit/font-fixtures` (@metamesh/testkit@0.19.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** Byte-verified local font selections and a reusable Generator service-preparation adapter. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Fixture provider matching createGeneratorTestRunner's asynchronous service boundary.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/testkit/font-fixtures` (@metamesh/testkit@0.
|
|
5
|
+
Import from `@metamesh/testkit/font-fixtures` (@metamesh/testkit@0.19.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** Fixture provider matching createGeneratorTestRunner's asynchronous service boundary. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Node-only local descriptor loader. Paths resolve beside the descriptor; bytes never come from a catalog.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/testkit/font-fixtures` (@metamesh/testkit@0.
|
|
5
|
+
Import from `@metamesh/testkit/font-fixtures` (@metamesh/testkit@0.19.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** Node-only local descriptor loader. Paths resolve beside the descriptor; bytes never come from a catalog. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A checked-in immutable font fixture; no catalog or network is used by the test harness.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/testkit/fonts` (@metamesh/testkit@0.
|
|
5
|
+
Import from `@metamesh/testkit/fonts` (@metamesh/testkit@0.19.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** A checked-in immutable font fixture; no catalog or network is used by the test harness. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Prepares the same synchronous text service used by Studio, from reproducible fixture bytes.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/testkit/fonts` (@metamesh/testkit@0.
|
|
5
|
+
Import from `@metamesh/testkit/fonts` (@metamesh/testkit@0.19.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** Prepares the same synchronous text service used by Studio, from reproducible fixture bytes. */
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# BufferContent
|
|
2
|
+
|
|
3
|
+
Numeric contents readable without copying their storage, including immutable model buffers.
|
|
4
|
+
|
|
5
|
+
Import from `@metamesh/testkit` (@metamesh/testkit@0.19.0).
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
/** Numeric contents readable without copying their storage, including immutable model buffers. */
|
|
9
|
+
export interface BufferContent {
|
|
10
|
+
readonly length: number;
|
|
11
|
+
at(index: number): number | undefined;
|
|
12
|
+
}
|
|
13
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# ContentMismatchError
|
|
2
|
+
|
|
3
|
+
A difference in valid buffer contents, distinct from malformed inputs or reader failures.
|
|
4
|
+
|
|
5
|
+
Import from `@metamesh/testkit` (@metamesh/testkit@0.19.0).
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
/** A difference in valid buffer contents, distinct from malformed inputs or reader failures. */
|
|
9
|
+
export declare class ContentMismatchError extends Error {
|
|
10
|
+
constructor(message: string);
|
|
11
|
+
}
|
|
12
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# GeneratorModelTestInput
|
|
2
|
+
|
|
3
|
+
Definition and executable runtime needed to validate and prepare a Generator.
|
|
4
|
+
|
|
5
|
+
Import from `@metamesh/testkit` (@metamesh/testkit@0.19.0).
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
/** Definition and executable runtime needed to validate and prepare a Generator. */
|
|
9
|
+
export interface GeneratorModelTestInput<D extends GeneratorDefinition> {
|
|
10
|
+
readonly definition: D;
|
|
11
|
+
readonly runtime: ModelProgram<GeneratorParams<D>, GeneratorServices>;
|
|
12
|
+
}
|
|
13
|
+
```
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# GeneratorModelTestOptions
|
|
2
|
+
|
|
3
|
+
Generation policy, optional test-owned engine, and asynchronous Generator asset preparation.
|
|
4
|
+
|
|
5
|
+
Import from `@metamesh/testkit` (@metamesh/testkit@0.19.0).
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
/** Generation policy, optional test-owned engine, and asynchronous Generator asset preparation. */
|
|
9
|
+
export type GeneratorModelTestOptions<D extends GeneratorDefinition> = Omit<GeneratorTestRunnerOptions<D>, "cache" | "verifyCache">;
|
|
10
|
+
```
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# GeneratorTestResult
|
|
2
|
+
|
|
3
|
+
Parameter or assertion failure, or a durable immutable model result.
|
|
4
|
+
|
|
5
|
+
Import from `@metamesh/testkit` (@metamesh/testkit@0.19.0).
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
/** Parameter or assertion failure, or a durable immutable model result. */
|
|
9
|
+
export type GeneratorTestResult<D extends GeneratorDefinition> = {
|
|
10
|
+
readonly type: "invalid";
|
|
11
|
+
readonly validation: ParameterValidationResult;
|
|
12
|
+
} | {
|
|
13
|
+
readonly type: "generated";
|
|
14
|
+
readonly parameters: GeneratorParams<D>;
|
|
15
|
+
readonly validation: ParameterValidationResult;
|
|
16
|
+
readonly model: ModelResult;
|
|
17
|
+
};
|
|
18
|
+
```
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
# GeneratorTestRunner
|
|
2
2
|
|
|
3
|
-
A lazy reusable Generator test session; dispose the runner
|
|
3
|
+
A lazy reusable Generator test session; dispose only the runner's caches.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/testkit` (@metamesh/testkit@0.
|
|
5
|
+
Import from `@metamesh/testkit` (@metamesh/testkit@0.19.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
|
-
/** A lazy reusable Generator test session; dispose the runner
|
|
8
|
+
/** A lazy reusable Generator test session; dispose only the runner's caches. */
|
|
9
9
|
export interface GeneratorTestRunner<D extends GeneratorDefinition> {
|
|
10
|
-
/** Checks declarations and assertions only. Set `
|
|
11
|
-
readonly
|
|
12
|
-
readonly
|
|
10
|
+
/** Checks declarations and assertions only. Set `validateInput: false` to probe deliberately invalid typed values. */
|
|
11
|
+
readonly check: (parameters: GeneratorParams<D>, options?: {
|
|
12
|
+
readonly validateInput?: boolean;
|
|
13
13
|
}) => Promise<ParameterValidationResult>;
|
|
14
|
-
/**
|
|
15
|
-
readonly
|
|
16
|
-
/**
|
|
17
|
-
readonly withModel: <Result>(parameters: Readonly<Record<string, unknown>>, inspect: (model: ModelSnapshot) => Result | PromiseLike<Result>) => Promise<Result>;
|
|
18
|
-
/** Releases runner caches; separately owned snapshots remain valid. */
|
|
14
|
+
/** Strictly validates inputs, prepares assets, and executes a persistent session. */
|
|
15
|
+
readonly run: (parameters: Readonly<Record<string, unknown>>) => Promise<GeneratorTestResult<D>>;
|
|
16
|
+
/** Releases runner caches; previously returned results remain valid. */
|
|
19
17
|
readonly dispose: () => void;
|
|
20
18
|
}
|
|
21
19
|
```
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Fixed host resources and optional asynchronous asset preparation.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/testkit` (@metamesh/testkit@0.
|
|
5
|
+
Import from `@metamesh/testkit` (@metamesh/testkit@0.19.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** Fixed host resources and optional asynchronous asset preparation. */
|
|
9
|
-
export interface GeneratorTestRunnerOptions<D extends GeneratorDefinition> {
|
|
9
|
+
export interface GeneratorTestRunnerOptions<D extends GeneratorDefinition> extends Omit<SessionOptions<GeneratorServices>, "services"> {
|
|
10
10
|
readonly prepareServices?: (definition: D, parameters: GeneratorParams<D>) => GeneratorServices | Promise<GeneratorServices>;
|
|
11
11
|
readonly engine?: ModelEngine;
|
|
12
|
-
readonly limits?: Partial<ModelingLimits>;
|
|
13
12
|
}
|
|
14
13
|
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# MeshContent
|
|
2
|
+
|
|
3
|
+
Ordered manufacturing geometry; placement, appearance and resource identities are separate.
|
|
4
|
+
|
|
5
|
+
Import from `@metamesh/testkit` (@metamesh/testkit@0.19.0).
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
/** Ordered manufacturing geometry; placement, appearance and resource identities are separate. */
|
|
9
|
+
export interface MeshContent {
|
|
10
|
+
readonly positions: BufferContent;
|
|
11
|
+
readonly indices: BufferContent;
|
|
12
|
+
}
|
|
13
|
+
```
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Physical expectations for a closed mesh; omitted facts are not asserted.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/testkit` (@metamesh/testkit@0.
|
|
5
|
+
Import from `@metamesh/testkit` (@metamesh/testkit@0.19.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** Physical expectations for a closed mesh; omitted facts are not asserted. */
|
|
@@ -13,7 +13,7 @@ export interface MeshMeasurementExpectation {
|
|
|
13
13
|
readonly signedVolume?: number;
|
|
14
14
|
/** Sum of triangle areas in square millimetres. */
|
|
15
15
|
readonly surfaceArea?: number;
|
|
16
|
-
/** Exact number of
|
|
17
|
-
readonly
|
|
16
|
+
/** Exact number of surface shells connected by shared indexed edges. */
|
|
17
|
+
readonly shellCount?: number;
|
|
18
18
|
}
|
|
19
19
|
```
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Absolute nonnegative comparison allowances; each omitted tolerance defaults to zero.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/testkit` (@metamesh/testkit@0.
|
|
5
|
+
Import from `@metamesh/testkit` (@metamesh/testkit@0.19.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** Absolute nonnegative comparison allowances; each omitted tolerance defaults to zero. */
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# RunModelOptions
|
|
2
|
+
|
|
3
|
+
Host policy and prepared services for an isolated model run; the engine remains host-owned.
|
|
4
|
+
|
|
5
|
+
Import from `@metamesh/testkit` (@metamesh/testkit@0.19.0).
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
/** Host policy and prepared services for an isolated model run; the engine remains host-owned. */
|
|
9
|
+
export interface RunModelOptions<S = Record<never, never>> extends ModelRunOptions<S> {
|
|
10
|
+
/** Reuse a test-owned engine; omitted uses the lazy shared test engine. */
|
|
11
|
+
readonly engine?: ModelEngine;
|
|
12
|
+
}
|
|
13
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# assertEqualBuffer
|
|
2
|
+
|
|
3
|
+
Asserts exact ordered numeric contents through length and at(index), without copying storage. Uses Object.is regardless of storage type: NaN equals NaN; signed zero differs. Throws ContentMismatchError for the first difference, TypeError for malformed inputs, and preserves reader failures. This assertion does not establish valid manufacturing geometry.
|
|
4
|
+
|
|
5
|
+
Import from `@metamesh/testkit` (@metamesh/testkit@0.19.0).
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
/**
|
|
9
|
+
* Asserts exact ordered numeric contents through length and at(index), without copying storage.
|
|
10
|
+
* Uses Object.is regardless of storage type: NaN equals NaN; signed zero differs.
|
|
11
|
+
* Throws ContentMismatchError for the first difference, TypeError for malformed inputs, and
|
|
12
|
+
* preserves reader failures. This assertion does not establish valid manufacturing geometry.
|
|
13
|
+
*/
|
|
14
|
+
export declare function assertEqualBuffer(actual: BufferContent, expected: BufferContent): void;
|
|
15
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# assertEqualMesh
|
|
2
|
+
|
|
3
|
+
Asserts identical positions and indices with buffer-specific mismatch diagnostics. Ignores metadata. Geometrically equivalent meshes with different triangulation or ordering can fail. Shares assertEqualBuffer's numeric equality, validation and error behavior without copying storage.
|
|
4
|
+
|
|
5
|
+
Import from `@metamesh/testkit` (@metamesh/testkit@0.19.0).
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
/**
|
|
9
|
+
* Asserts identical positions and indices with buffer-specific mismatch diagnostics.
|
|
10
|
+
* Ignores metadata. Geometrically equivalent meshes with different triangulation or ordering can fail.
|
|
11
|
+
* Shares assertEqualBuffer's numeric equality, validation and error behavior without copying storage.
|
|
12
|
+
*/
|
|
13
|
+
export declare function assertEqualMesh(actual: MeshContent, expected: MeshContent): void;
|
|
14
|
+
```
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# assertMeshMeasurements
|
|
2
2
|
|
|
3
3
|
Analyzes current buffers, requires closed oriented edge topology, and checks selected physical facts with explicit absolute tolerances. Returns fresh measurements without initializing an engine. These facts do not prove geometric equivalence or absence of self-intersections.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/testkit` (@metamesh/testkit@0.
|
|
5
|
+
Import from `@metamesh/testkit` (@metamesh/testkit@0.19.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/**
|
|
@@ -10,5 +10,5 @@ Import from `@metamesh/testkit` (@metamesh/testkit@0.17.0).
|
|
|
10
10
|
* facts with explicit absolute tolerances. Returns fresh measurements without initializing an
|
|
11
11
|
* engine. These facts do not prove geometric equivalence or absence of self-intersections.
|
|
12
12
|
*/
|
|
13
|
-
export declare function
|
|
13
|
+
export declare function assertMeshMeasurements(triangleMesh: TriangleMeshInput, expected: MeshMeasurementExpectation, tolerances?: MeshMeasurementTolerances): TriangleMeshAnalysis;
|
|
14
14
|
```
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# assertValidDefaults
|
|
2
2
|
|
|
3
3
|
Throws unless defaults strictly decode and equal the defaults derived from the definition.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/testkit` (@metamesh/testkit@0.
|
|
5
|
+
Import from `@metamesh/testkit` (@metamesh/testkit@0.19.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** Throws unless defaults strictly decode and equal the defaults derived from the definition. */
|
|
9
|
-
export declare function
|
|
9
|
+
export declare function assertValidDefaults<const D extends GeneratorDefinition>(definition: D, defaults: GeneratorParams<D>): void;
|
|
10
10
|
```
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# assertValidDefinition
|
|
2
|
+
|
|
3
|
+
Strictly parses a definition and requires its JSON round trip to retain the canonical package representation.
|
|
4
|
+
|
|
5
|
+
Import from `@metamesh/testkit` (@metamesh/testkit@0.19.0).
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
/** Strictly parses a definition and requires its JSON round trip to retain the canonical package representation. */
|
|
9
|
+
export declare function assertValidDefinition(definition: GeneratorDefinition): void;
|
|
10
|
+
```
|