diff --git a/package-lock.json b/package-lock.json index 74181b51..ae9c3dff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -881,9 +881,9 @@ "integrity": "sha512-ch/pPoOEIeKe1PKbfuLEIM8MAdTiR+fr9BYk6VTlIHrya5f5d8shJg6h/oQgD3K/ftjU/RYBGGalw9Pz4pCXew==" }, "@open-rpc/examples": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@open-rpc/examples/-/examples-1.6.0.tgz", - "integrity": "sha512-Fq704vsc0w7z8PI8VEJas6DmIhEqnUnP5TBwBMG6CPgPvqXIobqW51qeP+P6PUkJQyP9u9JlZJsLFqZojKl9cQ==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@open-rpc/examples/-/examples-1.6.1.tgz", + "integrity": "sha512-R0R8IimU5yJeAFe94GspnynIj0bv2AM57Px3cTwZkVwg6fCYOw+9l4gOQc402f+kSvZC7/BjNPyGtQ83oDbDYw==", "dev": true }, "@open-rpc/meta-schema": { diff --git a/package.json b/package.json index cf442894..9335e761 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "ws": "^7.3.1" }, "devDependencies": { - "@open-rpc/examples": "^1.6.0", + "@open-rpc/examples": "^1.6.1", "@open-rpc/meta-schema": "^1.13.20", "@types/body-parser": "^1.19.0", "@types/connect": "^3.4.33", diff --git a/src/router.test.ts b/src/router.test.ts index aa564803..de093f42 100644 --- a/src/router.test.ts +++ b/src/router.test.ts @@ -63,9 +63,12 @@ describe("router", () => { if (exampleName === "petstoreByName") { it("handles params by name", async () => { const router = new Router(parsedExample, makeMethodMapping(parsedExample.methods)); - const result = await router.call("list_pets", { limit: 10 }); + const result = await router.call("list_pets", { limit: 1 }); expect(result).toBeDefined(); expect(result.result.length).toBeGreaterThan(0); + expect(result.result[0].name).toBe("fluffy"); + expect(result.result[0].id).toBe(7); + expect(result.result[0].tag).toBe("poodle"); }); } if (exampleName === "simpleMath") {