I am applying toBeA() method on expect() and it gives the error TypeError: Cannot read property 'toBeA' of undefined how can I apply these methods by chaining.
utils.test.js code
const expect = require('expect');
const utils = require('./utils');
it('should add two numbers',() => {
var res = utils.add(44,11);
expect(res).toBe(55).toBeA('number'); ----> here it gives the above error.
});
it('Object should be equal',() => {
expect([1,2,5,7]).toInclude(5); ---> here it gives the error TypeError: expect(...).toInclude is not a function
});
utils.js code
module.exports.add = (a, b) => a + b ;
How do I fix this issue ?