Skip to content

Commit b58ffa0

Browse files
AlexLovserclaude
andcommitted
Stop pinning the package version in the User-Agent test
The assertion compared the resolved header against the literal "skylink-api-node/0.1.0", so the suite failed on any version bump — it would have blocked the very first release after 0.1.0, in the release workflow, with an error that looks nothing like its cause. The header is now compared against the USER_AGENT constant, and the shape is asserted separately, so a missing or malformed version is still caught while a bump is not. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent adc72f0 commit b58ffa0

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

tests/client.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,11 @@ describe("resolveConfig", () => {
8282

8383
it("sends the node User-Agent", () => {
8484
expect(USER_AGENT).toBe(`skylink-api-node/${VERSION}`);
85-
expect(resolveConfig({ apiKey: "k" }).defaultHeaders["User-Agent"]).toBe(
86-
"skylink-api-node/0.1.0",
87-
);
85+
expect(resolveConfig({ apiKey: "k" }).defaultHeaders["User-Agent"]).toBe(USER_AGENT);
86+
// Shape, not a pinned number: asserting the literal version here made every
87+
// release fail the suite, while a missing or malformed one is still caught.
88+
expect(USER_AGENT.startsWith("skylink-api-node/")).toBe(true);
89+
expect(VERSION.split(".")).toHaveLength(3);
8890
});
8991

9092
it("falls back to RAPIDAPI_KEY on the default provider", () => {

0 commit comments

Comments
 (0)