This commit is contained in:
1 parent
e2445980f9
commit
31a47346ea
5 files changed
+158
-30
No files matched your search
@@ -17,11 +17,12 @@ import {
|
||||
|
||||
test("REST compile contract shape is stable with version metadata", () => {
|
||||
const parsed = parsePayloadOptions({ payload: fixture, options: { render_mode: "schematic_stub" } });
|
||||
const body = withRestEnvelopeMeta(compile(parsed.payload, parsed.options));
|
||||
const body = withRestEnvelopeMeta({ request_id: "req-test-1", ...compile(parsed.payload, parsed.options) });
|
||||
|
||||
assert.equal(body.ok, true);
|
||||
assert.equal(body.api_version, REST_API_VERSION);
|
||||
assert.equal(body.schema_version, REST_SCHEMA_VERSION);
|
||||
assert.equal(body.request_id, "req-test-1");
|
||||
assert.ok(Array.isArray(body.errors));
|
||||
assert.ok(Array.isArray(body.warnings));
|
||||
assert.ok(Array.isArray(body.bus_groups));
|
||||
@@ -42,10 +43,11 @@ test("REST analyze contract shape is stable with version metadata", () => {
|
||||
});
|
||||
|
||||
test("REST error envelope exposes stable code/message fields", () => {
|
||||
const body = errorEnvelope("rate_limited", "Rate limit exceeded. Try again shortly.");
|
||||
const body = errorEnvelope("rate_limited", "Rate limit exceeded. Try again shortly.", { request_id: "req-test-2" });
|
||||
assert.equal(body.ok, false);
|
||||
assert.equal(body.error.code, "rate_limited");
|
||||
assert.equal(typeof body.error.message, "string");
|
||||
assert.equal(body.request_id, "req-test-2");
|
||||
});
|
||||
|
||||
test("MCP schemeta_compile returns structured content with version metadata", () => {
|
||||
|
||||
Reference in new issue
Block a user