1 | /* eslint-disable no-new */ |
||
2 | import { expect, describe, it } from '@jest/globals'; |
||
3 | import Int from '../int'; |
||
4 | |||
5 | describe('Test int.js', () => { |
||
6 | it('It should build a int', () => { |
||
7 | const a = new Int(42); |
||
8 | |||
9 | expect(a.valueOf()).toEqual(42); |
||
10 | expect(a instanceof Int).toEqual(true); |
||
11 | expect(a instanceof Number).toEqual(true); |
||
12 | }); |
||
13 | |||
14 | it('It should throw an exception', () => { |
||
15 | expect(() => { |
||
16 | new Int(42.42); |
||
1 ignored issue
–
show
Unused Code
Best Practice
introduced
by
Loading history...
|
|||
17 | }).toThrowError('42.42 isnt an integer'); |
||
18 | }); |
||
19 | }); |
||
20 |