All exercise code that should not run during a unit test is now placed in a main() function. This simplifies the unit tests and also eliminates the need for global variables which students often use inappropriately (see example below).
Unit tests now also warns about spurious console.log's
Corrected spelling for dice exercises: singular die and plural dice
Fixed some bugs in the test runner and unit tests that cropped up in the class 34 homework
function giveCompliment(/* TODO parameter(s) go here */) {
// TODO complete this function
}
function main() {
// TODO substitute your own name for "HackYourFuture"
const myName = 'HackYourFuture';
console.log(giveCompliment(myName));
...
}
// ! Do not change or remove the code below
if (process.env.NODE_ENV !== 'test') {
main();
}
module.exports = giveCompliment;
Summary of updates and improvements:
main()
function. This simplifies the unit tests and also eliminates the need for global variables which students often use inappropriately (see example below).