I installed Mocha tests and Chai to VSC and wrote a simple function to test it. file1:
module.exports = function add(x,y) {
return x + y
}
file2 (unit tests)
const { expect } = require('chai');
const add = require('../exersize');
describe('add numbers func', () => {
it('add function is a function', () => {
expect(typeof add).to.equal('function')
});
});
When I hit f5 to see the result from the unit test in the console, I see an error in "fs.js" online 121
What am i doing wrong?
Aucun commentaire:
Enregistrer un commentaire