Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion scripts/check-package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,9 @@ try {
step("checking npm publish leaves the manifest as it is");
// `npm pack` ships a manifest `npm publish` would rewrite: a `./` before a bin path has
// publish delete that bin with a warning and exit 0. The version is moved off the real one
// so the dry run never meets a version the registry already holds.
// so the dry run never meets a version the registry already holds. Without a token it warns
// that it needs a login; a dry run only checks one is configured, so a dummy one stands in,
// whoever is or is not logged in.
const unpacked = path.join(workDir, "unpacked");
mkdirSync(unpacked);
run("tar", ["-xzf", tarball, "-C", unpacked], workDir);
Expand All @@ -316,6 +318,7 @@ try {
const shipped = JSON.parse(readFileSync(manifestPath, "utf8")) as { version: string };
shipped.version = `${shipped.version}-package-check`;
writeFileSync(manifestPath, JSON.stringify(shipped, null, 2));
writeFileSync(path.join(publishable, ".npmrc"), "//registry.npmjs.org/:_authToken=dry-run\n");
const dryRun = spawnSync(
"npm",
["publish", "--dry-run", "--ignore-scripts", "--tag", "package-check"],
Expand Down
8 changes: 5 additions & 3 deletions src/nostr-channel/connecting.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,11 @@ describe("the Nostr Channel's one connection", () => {
});

const requests = relay.received.filter((message) => message.verb === "REQ");
assert.equal(requests.length >= 2, true);
assert.notEqual(requests.at(-1)?.connection, requests[0]?.connection);
assert.deepEqual(requests.at(-1)?.filters, requests[0]?.filters);
const resubscribed = requests.find(
(message) => message.connection !== requests[0]?.connection,
);
assert.notEqual(resubscribed, undefined);
assert.deepEqual(resubscribed?.filters, requests[0]?.filters);
});
});

Expand Down
7 changes: 5 additions & 2 deletions src/pi/runtime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,11 @@ describe("the Agent Instance the Operator has to run", () => {
);

const error = failure(outcome);
assert.match(error, /without agent_settled/);
assert.match(error, /connection failed/);
assert.match(
error,
/^Session user_42: (No records received|Stream ended after \d+ records without agent_settled)/,
);
assert.match(error, /The connection failed: .*ECONNRESET/);
});

it("is a failed Run when it goes away before answering a command", async () => {
Expand Down
Loading