diff --git a/scripts/check-package.ts b/scripts/check-package.ts index 8ef37ef..b021c32 100644 --- a/scripts/check-package.ts +++ b/scripts/check-package.ts @@ -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); @@ -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"], diff --git a/src/nostr-channel/connecting.test.ts b/src/nostr-channel/connecting.test.ts index 2fe9c75..53d0c9f 100644 --- a/src/nostr-channel/connecting.test.ts +++ b/src/nostr-channel/connecting.test.ts @@ -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); }); }); diff --git a/src/pi/runtime.test.ts b/src/pi/runtime.test.ts index 42e317f..1d63518 100644 --- a/src/pi/runtime.test.ts +++ b/src/pi/runtime.test.ts @@ -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 () => {