Closed davidshare closed 6 years ago
Which version of expect
are you using? v21+ is managed by jest.
I get same error with expect
22.0.6.
Copied the code straight from the README.md
describe('Unit Test', () => {
it('should not fail...?', () => {
expect(2).toBeA('number');
});
});
@MatthewKosloski expect v21+ is managed by the jest team; that includes v22.
I'm trying to check if the result of a function is a number, and it keeps returning an error that it cannot read property toBeOf undefined. Here is the code
it('should square a numbers', ()=>{ let res = utils.square(5); expect(res).toBe(25).toBeA('number'); });