`toBeInstanceOf(Number)` does not work in jest
expect(value).not.toBeNaN();
Edit: I would go with @bszoms solution:
expect(typeof value).toBe('number')
The following works for all constructors:
expect(value).toEqual(expect.any(Number));
You can also do this: expect(typeof <value>).toBe('number')
Or you can use jest-extended, which adds a whole range of matchers including toBeNumber
.
Both courtesy of the discussion here.