Skip to content

Commit 4ba089e

Browse files
committed
v2 unit test
1 parent f3cf83f commit 4ba089e

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

test/unit/v1/statement.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ describe("parse values", () => {
313313
new BigNumber(1000000000000000000000000000000000000)
314314
);
315315
});
316-
it("parses biging null into BigNumber container", () => {
316+
it("parses bigint null into BigNumber container", () => {
317317
allure.description("Verify nullable bigint is parsed correctly");
318318
const row = {
319319
big: "1000000000000000000000000000000000000"

test/unit/v2/statement.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,18 @@ describe("parse values", () => {
321321
const res: Record<string, Buffer> = hydrateRow(row, meta, {});
322322
expect(res["bytea"]).toEqual(Buffer.from("hello_world"));
323323
});
324+
it("parses bigint null into BigNumber container", () => {
325+
allure.description("Verify nullable bigint is parsed correctly");
326+
const row = {
327+
big: "1000000000000000000000000000000000000"
328+
};
329+
const meta = [{ name: "big", type: "long null" }];
330+
const res: Record<string, BigNumber> = hydrateRow(row, meta, {});
331+
expect(res["big"] instanceof BigNumber).toBe(true);
332+
expect(res["big"]).toEqual(
333+
new BigNumber(1000000000000000000000000000000000000)
334+
);
335+
});
324336
it("parses struct into object", () => {
325337
const row = {
326338
s: { a: [1, 2], b: "\\x68656c6c6f5f776f726c64" }

0 commit comments

Comments
 (0)