vendredi 18 octobre 2019

Error on line 121 in fs.js when trying to run Unit test in VSC

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

enter image description here

What am i doing wrong?

Aucun commentaire:

Enregistrer un commentaire