Skip to content

Commit b3e017d

Browse files
committed
test: throws if number cannot be converted into BigInt
1 parent 583e04d commit b3e017d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/util-dynamodb/src/convertToNative.spec.ts

+8
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ describe("convertToNative", () => {
8686
);
8787
});
8888
});
89+
90+
[`${Number.MAX_SAFE_INTEGER + 2}.1`, `${Number.MIN_SAFE_INTEGER - 2}.1`].forEach((numString) => {
91+
it(`throws if number cannot be converted into BigInt: ${numString}`, () => {
92+
expect(() => {
93+
convertToNative({ N: numString });
94+
}).toThrowError(`${numString} can't be converted to BigInt. Set options.wrapNumbers to get string value.`);
95+
});
96+
});
8997
});
9098

9199
describe("binary", () => {

0 commit comments

Comments
 (0)