Skip to content
Merged
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/api/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class TreasuryClient {
}

async getAvgInterestRates(params: QueryParams = {}): Promise<TreasuryResponse> {
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<TreasuryResponse> {
Expand Down
2 changes: 1 addition & 1 deletion src/tests/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand Down
2 changes: 1 addition & 1 deletion src/tests/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading