From f04cce5428350c5fed367ca8f69f84e9040b8576 Mon Sep 17 00:00:00 2001 From: Pavel Fadeev Date: Mon, 30 Mar 2026 20:16:57 +0200 Subject: [PATCH 1/4] Fix rates integration test: add sort to avoid slow default query --- src/tests/integration.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/integration.test.ts b/src/tests/integration.test.ts index 6f10e76..0603484 100644 --- a/src/tests/integration.test.ts +++ b/src/tests/integration.test.ts @@ -71,7 +71,7 @@ describe("CLI integration (live API)", () => { }); it("treasury rates returns interest rate data", async () => { - const { stdout } = await run(["rates", "--limit", "5"]); + const { stdout } = await run(["rates", "--limit", "5", "--sort", "-record_date"]); const data = JSON.parse(stdout); assert.ok(Array.isArray(data.data)); assert.ok(data.data.length > 0); From 2abdd0beb4ef7b9ee999f6ed08fa04606193a611 Mon Sep 17 00:00:00 2001 From: Pavel Fadeev Date: Mon, 30 Mar 2026 20:18:59 +0200 Subject: [PATCH 2/4] Fix avg_interest_rates: use v2 endpoint (v1 returns empty on CI) --- src/api/client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/client.ts b/src/api/client.ts index 48501c2..e201639 100644 --- a/src/api/client.ts +++ b/src/api/client.ts @@ -69,7 +69,7 @@ export class TreasuryClient { } async getAvgInterestRates(params: QueryParams = {}): Promise { - return this.request("v1/accounting/od/avg_interest_rates", params); + return this.request("v2/accounting/od/avg_interest_rates", params); } async getMspdTable1(params: QueryParams = {}): Promise { From 7c22c74e5c5f7b18919f644059590ed9c9f45c99 Mon Sep 17 00:00:00 2001 From: Pavel Fadeev Date: Mon, 30 Mar 2026 20:20:21 +0200 Subject: [PATCH 3/4] Separate unit tests from integration tests in npm test --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f57f936..2c86ef1 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "tsc", "dev": "tsx src/cli.ts", - "test": "tsx --test src/tests/*.test.ts", + "test": "tsx --test src/tests/client.test.ts src/tests/cli.test.ts", "test:watch": "tsx --test --watch src/tests/*.test.ts", "test:integration": "tsx --test src/tests/integration.test.ts", "prepublishOnly": "npm run build && npm test", From 602f0a4b57a987a3114bb5509d29344d2b3c428b Mon Sep 17 00:00:00 2001 From: Pavel Fadeev Date: Mon, 30 Mar 2026 20:21:43 +0200 Subject: [PATCH 4/4] Fix test: update expected endpoint path to v2 --- src/tests/client.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/client.test.ts b/src/tests/client.test.ts index 9cedef5..2953cd9 100644 --- a/src/tests/client.test.ts +++ b/src/tests/client.test.ts @@ -127,7 +127,7 @@ describe("TreasuryClient", () => { mockFetch(AVG_INTEREST_RATES_RESPONSE); const result = await client.getAvgInterestRates(); const url = getCalledUrl(); - assert.equal(url.pathname, "/services/api/fiscal_service/v1/accounting/od/avg_interest_rates"); + assert.equal(url.pathname, "/services/api/fiscal_service/v2/accounting/od/avg_interest_rates"); assert.equal(result.data.length, 2); });