Skip to content

Commit

Permalink
Checking if node6 breaks with lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshRosenstein committed Apr 30, 2019
1 parent 3459c44 commit 592d6f3
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/jest-matcher-utils/src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,20 +309,27 @@ describe('getLabelPrinter', () => {
});

if (isBigIntAllowed) {
// See if node 6-8 breaks using a lookup
function getBigInt(number: number) {
// @ts-ignore
const map = [0n, 1n, 2n, 3n];
return map[number];
}

describe('bigint Syntax', () => {
test('stringify()', () => {
// @ts-ignore
expect(stringify(1n)).toBe('1n');
expect(stringify(getBigInt(1))).toBe('1n');
});

test('toEqual()', () => {
// @ts-ignore
expect(1n).toEqual(BigInt(1));
expect(getBigInt(1)).toEqual(BigInt(1));
});

test('diff()', () => {
// @ts-ignore
expect(diff(1n, 2n)).toBe(null);
expect(diff(getBigInt(1), getBigInt(2))).toBe(null);
});
});
}

0 comments on commit 592d6f3

Please sign in to comment.