feat: add exact signed money parsing and formatting

This commit is contained in:
jb
2026-09-18 23:55:32 -04:00
parent 49495af196
commit aea41d8cea
6 changed files with 202 additions and 24 deletions
+8
View File
@@ -123,6 +123,14 @@ describe("central ESI client", () => {
});
describe("ESI market estimates", () => {
test("keeps the inherited non-negative market-price policy", async () => {
const queued = queueFetch([
response([{ type_id: 34, average_price: -1 }], { ETag: '"negative"', "Cache-Control": "max-age=60" }),
]);
const client = new EsiClient({ userAgent: "test", fetch: queued.fetch, now: () => 1234 });
await expect(new EsiMarketEstimates(client).estimates([34])).rejects.toMatchObject({ code: "invalid_price" });
});
test("uses average prices only and returns cents with retrieval provenance", async () => {
const queued = queueFetch([
response([