This project is written in Node, and tested with Vitest - Blazing Fast Unit Test Framework.
When npm runs vitest, all the tests are failing as seen at the end of its output to the console.
Since we have 4 files, vitest sees 4 test suites. Within these 4 suites, we have a total of 35 coding skill assignments, each with a test. The comments in the files will explain what each coding skill assignment must accomplish.
Fixing the code will make the tests pass and show in green in the console. Here is the vitest output when all the tests pass.
npm install
Start with the first file.
npm run test:1
The above npm command is equivalent to the following but is easier to type:
npx vitest tests/basics-01.test.js --globals --run --reporter verbose
as inside the package.json you see it is listed in the scripts:
"test:1": "vitest tests/basics-01.test.js --globals --run --reporter verbose"
Since we have four files that need individual editing, we want to run individual testing as well.
NOTE: As you are editing, don't forget to save the file before you try running the test or it won't be able to see the changes.
So the above example tests the first file tests/basics-01.test.js
and outputs the results to the console.
If a test fails, vitest will identify it as failing and print one or more error messages, depending on the test expectations.
One-by-one and in order, edit each JavaScript file and follow the instructions for each coding skill. You should run the test after each completed skill and see the pass count increase. When one file passes completely, you are ready for the next file.
Start with basics-01.test.js and finish with basics-04.test
When you feel the coding skills are completed, the following command will test all files in the repo that end in test.js
npm test
Commit and push after all tests pass. GitHub will run the same tests and report pass/fail.