Skip to content

Commit

Permalink
Merge pull request #31 from ocknamo/ci/fix-test
Browse files Browse the repository at this point in the history
fix: correct expected subscription id
  • Loading branch information
penpenpng authored Jun 16, 2023
2 parents 72b6bf6 + 35162f3 commit ebeafd7
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/test/strategy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ describe("Single relay case", () => {
req.emit([{ kinds: [0], limit: 5 }]);
await expectReceiveMessage(relay, [
"REQ",
"rx-nostr:sub:0",
"sub:0",
{ kinds: [0], limit: 5 },
]);
await eoseSync;
await expectReceiveMessage(relay, ["CLOSE", "rx-nostr:sub:0"]);
await expectReceiveMessage(relay, ["CLOSE", "sub:0"]);
});

test("[backward] Receipt of EOSE does not terminate the Observable.", async () => {
Expand Down Expand Up @@ -83,22 +83,22 @@ describe("Single relay case", () => {

await expectReceiveMessage(relay, [
"REQ",
"rx-nostr:sub:0",
"sub:0",
{ kinds: [0], limit: 3 },
]);
await expectReceiveMessage(relay, [
"REQ",
"rx-nostr:sub:1",
"sub:1",
{ kinds: [0], limit: 2 },
]);
await expectReceiveMessage(relay, [
"REQ",
"rx-nostr:sub:2",
"sub:2",
{ kinds: [0], limit: 1 },
]);
await expectReceiveMessage(relay, ["CLOSE", "rx-nostr:sub:2"]);
await expectReceiveMessage(relay, ["CLOSE", "rx-nostr:sub:1"]);
await expectReceiveMessage(relay, ["CLOSE", "rx-nostr:sub:0"]);
await expectReceiveMessage(relay, ["CLOSE", "sub:2"]);
await expectReceiveMessage(relay, ["CLOSE", "sub:1"]);
await expectReceiveMessage(relay, ["CLOSE", "sub:0"]);
});

test("[forward] Each REQ is published with the same subId.", async () => {
Expand All @@ -112,20 +112,20 @@ describe("Single relay case", () => {

await expectReceiveMessage(relay, [
"REQ",
"rx-nostr:sub:0",
"sub:0",
{ kinds: [0], limit: 1 },
]);
await expectReceiveMessage(relay, [
"REQ",
"rx-nostr:sub:0",
"sub:0",
{ kinds: [0], limit: 2 },
]);
await expectReceiveMessage(relay, [
"REQ",
"rx-nostr:sub:0",
"sub:0",
{ kinds: [0], limit: 3 },
]);
await expectReceiveMessage(relay, ["CLOSE", "rx-nostr:sub:0"]);
await expectReceiveMessage(relay, ["CLOSE", "sub:0"]);
});

test("[oneshot] Receipt of EOSE terminates the Observable.", async () => {
Expand Down

0 comments on commit ebeafd7

Please sign in to comment.