Skip to content

Commit

Permalink
add test for toBigNumber
Browse files Browse the repository at this point in the history
  • Loading branch information
jscriptcoder committed Jul 5, 2023
1 parent 8e98f3d commit 30e5a80
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/bridge-ui/src/utils/toBigNumber.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { BigNumber } from "ethers";

import { toBigNumber } from "./toBigNumber";

describe('toBigNumber', () => {
it('should handle different notation for big ints', () => {
expect(toBigNumber('1000000000000000000000').toString()).toEqual('1000000000000000000000');
expect(toBigNumber(2e+21).toString()).toEqual('2000000000000000000000');
expect(toBigNumber(3e21).toString()).toEqual('3000000000000000000000');
expect(toBigNumber(1000).toString()).toEqual('1000');
});
});

0 comments on commit 30e5a80

Please sign in to comment.