I am currently working on a unit test to validate a list of elements.
Example:
arr = [
{ element : "aaa",
validation : false
},
{ element: "bbbb",
validation: true
},
{ element: "ccc",
validation: false
}
While running my unit test, I encountered an issue where Mocha and Chai would stop at the first invalid element. How can I make Mocha continue the test even if it encounters an error?
This is my current code for the "it" block:
it('Read element', () => {
let length = arr.length - 1;
for (let i =0; i<= length; i++ ) {
assert.equal(arr[i].validation, true, 'route ' + arr[i].element+ ' should be valid');
}
});