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", 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 { 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); }); 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);