Skip to content
Closed
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
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 14 additions & 1 deletion src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Regression tests for issues #14 and #15.
// Regression tests for issues #14, #15, and #17.
// Minimal and self-contained (see issue #16 for a full test harness).
import { test } from "node:test";
import assert from "node:assert/strict";
Expand All @@ -12,6 +12,11 @@ const buildEntry = join(here, "..", "build", "index.js");
const pkg = JSON.parse(
readFileSync(join(here, "..", "package.json"), "utf8"),
) as { version: string };
const lockfile = JSON.parse(
readFileSync(join(here, "..", "package-lock.json"), "utf8"),
) as {
packages: Record<string, { version?: string }>;
};

// Issue #14: the server must advertise the real package version, not a
// stale hardcoded one, and --version must agree with package.json.
Expand Down Expand Up @@ -53,3 +58,11 @@ test("#15: submit_pr validates required args before building the request body",
"required-arg validation must run before the body is built",
);
});

// Issue #17: npm audit flagged vulnerable transitive lockfile resolutions.
// This test fails on the old lockfile and keeps future lock refreshes honest.
test("#17: lockfile resolves audit-sensitive transitives to patched versions", () => {
assert.equal(lockfile.packages["node_modules/express-rate-limit"]?.version, "8.5.2");
assert.equal(lockfile.packages["node_modules/hono"]?.version, "4.12.19");
assert.equal(lockfile.packages["node_modules/ip-address"]?.version, "10.2.0");
});