aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/bigint.test.js
blob: ba71f3f9f2d467cf7629169e2c209bb6494f80ce (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
import { describe, expect, it } from "bun:test";

it("BigInt compares correctly (literal)", () => {
  expect(42n).toBe(42n);
});

it("BigInt compares correctly (object)", () => {
  expect(BigInt(42n)).toBe(BigInt(42n));
  expect(42n).toBe(BigInt(42n));
  expect(BigInt(Bun.inspect(42n).substring(0, 2))).toBe(BigInt(42n));
  expect(BigInt(42n).valueOf()).toBe(BigInt(42n));
});