Skip to content

Commit

Permalink
Fix error assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Sep 26, 2024
1 parent 1aeebe1 commit 0e2a099
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/cli/test/sim/endpoints.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ await env.tracker.assert(
await env.tracker.assert("should return HTTP error responses in a spec compliant format", async () => {
// ApiError with status 400 is thrown by handler
const res1 = await node.api.beacon.getStateValidator({stateId: "current", validatorId: 1});
assert.equal(res1.json(), {code: 400, message: "Invalid block id 'current'"});
assert.equal(JSON.parse(await res1.text()), {code: 400, message: "Invalid block id 'current'"});

// JSON schema validation failed"
// JSON schema validation failed
const res2 = await node.api.beacon.getPoolAttestationsV2({slot: "current" as unknown as number, committeeIndex: 123});
assert.equal(res2.json(), {code: 400, message: "slot must be integer"});
assert.equal(JSON.parse(await res2.text()), {code: 400, message: "slot must be integer"});

// Route does not exist
const res3 = await fetch(`${node.restPublicUrl}/not/implemented/route`);
assert.equal(res3.json(), {code: 404, message: "Route GET:/not/implemented/route not found"});
assert.equal(JSON.parse(await res3.text()), {code: 404, message: "Route GET:/not/implemented/route not found"});
});

await env.tracker.assert("BN Not Synced", async () => {
Expand Down

0 comments on commit 0e2a099

Please sign in to comment.