@o-lang/resolver-tests 1.0.7 → 1.0.8
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/lib/runner.js +6 -5
- package/package.json +1 -1
package/lib/runner.js
CHANGED
|
@@ -85,6 +85,7 @@ function checkOutputIsObject(output) {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
function checkOutputFieldsMatchContract(output, resolverMeta) {
|
|
88
|
+
if (!output) return false; // 🔒 SAFETY: prevent 'in' operator crash on null/undefined
|
|
88
89
|
const declaredNames = (resolverMeta.outputs || []).map(o => o.name);
|
|
89
90
|
return declaredNames.every(name => name in output);
|
|
90
91
|
}
|
|
@@ -171,7 +172,7 @@ function runAssertions(testSpec, target, status = {}) {
|
|
|
171
172
|
// ----------------------
|
|
172
173
|
// Runtime resolver invoker with observation
|
|
173
174
|
// ----------------------
|
|
174
|
-
async function invokeResolverWithObservation(resolver, resolverMeta, testSpec) {
|
|
175
|
+
async function invokeResolverWithObservation(resolver, resolverMeta, testSpec, fixture) {
|
|
175
176
|
const ctx = {
|
|
176
177
|
resolver,
|
|
177
178
|
resolverMeta,
|
|
@@ -182,10 +183,9 @@ async function invokeResolverWithObservation(resolver, resolverMeta, testSpec) {
|
|
|
182
183
|
retryCount: 0,
|
|
183
184
|
};
|
|
184
185
|
|
|
185
|
-
// Use
|
|
186
|
-
const input = {};
|
|
186
|
+
// ✅ Use input from test fixture (critical fix!)
|
|
187
|
+
const input = fixture?.invoke || {};
|
|
187
188
|
|
|
188
|
-
// Run multiple times for determinism test
|
|
189
189
|
const runs = testSpec.test_id === 'R-011-determinism' ? 3 : 1;
|
|
190
190
|
|
|
191
191
|
for (let i = 0; i < runs; i++) {
|
|
@@ -257,7 +257,8 @@ async function runAllTests({ suites, resolver }) {
|
|
|
257
257
|
} else if (testSpec.category === "resolver-runtime") {
|
|
258
258
|
// R-006 → R-012: Observe real resolver behavior
|
|
259
259
|
try {
|
|
260
|
-
|
|
260
|
+
// ✅ Pass fixture to invoker
|
|
261
|
+
const runtimeContext = await invokeResolverWithObservation(resolver, resolverMeta, testSpec, fixture);
|
|
261
262
|
const result = runAssertions(testSpec, runtimeContext);
|
|
262
263
|
|
|
263
264
|
if (!result.ok) {
|