Testing Flashcards
1
Q
adding assert from node.js
A
const assert = require(‘assert’);
let sum = 0;
forEach([1, 2, 3], (value) => {
sum += value;
});
console. log(sum);
assert. strictEqual(sum, 6, ‘Expected forEach to sum the array’);