A simple way to quickly assess how complete and robust each student's project assignment is. The majority of the unit tests are taken directly from the project assignment directions.
As long as the student has followed the function names as laid out in the directions the test files should hook up nicely.
-
Clone this repo.
-
Install the Mocha.js test framework and Chai.js assertion libraries:
cd BA_Test_Runner (or whatever you named the repo locally)
npm install
-
For the student you are reviewing make a local copy of their
validator.js
andutilities.js
files. -
For ease of testing make sure to expose both the
validator
andutilities
objects (remove or comment out the IIFE if present) in each student file. -
In
testrunner.html
load up the student'sutilities.js
andvalidator.js
files under the "load student code files for testing here" comment. I've included a directory for both student utilities and student validator files but they can live anywhere. -
Open up
testrunner.html
in a new browser window. The results of each test should show up along with any error messages.