Passed
Push — master ( 527212...0fe9bd )
by Pieter Epeüs
02:47 queued 52s
created

src/__tests__/int.spec.js (1 issue)

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
The object created with new Int(42.42) is not used but discarded. Consider invoking another function instead of a constructor if you are doing this purely for side effects.
Loading history...
17
        }).toThrowError('42.42 isnt an integer');
18
    });
19
});
20