@@ -474,11 +474,19 @@ As always, it's best to try to
474474make smaller changes, test them, and once they work
475475check them in. That way you won't need to debug a long complicated
476476set of changes.
477+ See the next section on [ testing] ( #testing ) .
478+
479+ ### Testing
480+
481+ Every time you reload the lab HTML, the program will reload and
482+ all self-tests will be run. If you see no errors, and the text entry
483+ areas are showing in yellow, a * lot* of things are working well.
477484
478485Please create tests! You should create test cases for full attempts
479486(` successes ` should pass, ` failures ` should fail) and test cases
480487for hints (` examples ` ).
481- Remember, hints are checked in order - it's possible to create a hint
488+
489+ Hints are checked in order - it's possible to create a hint
482490that won't trigger because something earlier would always match.
483491All tests are automatically re-run every time the page is (re)loaded.
484492
@@ -487,20 +495,29 @@ Each example is an array of answers. If you use an index, the other index
487495values aren't considered. We suggest using ` null ` for array entries
488496that aren't relevant for the test.
489497
498+ The script ` mass-test ` for Linux or MacOS will automatically open
499+ every lab in your default browser's current window.
500+ This will rerun all our lab automated tests.
501+ If every lab has a yellow text entry area, and doesn't show test failure
502+ alerts, then all the labs pass the test.
503+
490504### Debugging
491505
492506Sadly, sometimes things don't work; here are some debugging tips for labs.
493507
494- Every time you reload the lab HTML, the program will reload and
495- all self-tests will be run. If you see no errors, and the text entry
496- areas are showing in yellow, a * lot* of things are working well.
497-
498508If you load a page and the text entries don't have color, there
499509was a serious problem loading things.
500510Use your browser's * Developer Tools* to show details.
501511In Chrome, this is More Tools -> Developer Tools -> (Console Tab).
502512In Firefox, this is More Tools -> Web Developer Tools -> (Console Tab).
503513You may need to further open specifics to see them.
514+ Often the problem is that (1) a line just before added material needs a
515+ trailing comma, or (2) a string was not properly closed (e.g.,
516+ it is double-quoted but includes double-quote that was not properly escaped).
517+
518+ If the JavaScript loads successfully, but then a self-test fails,
519+ you'll see alert box(es) telling you which tests failed.
520+ See [ testing] ( #testing ) .
504521
505522Note:
506523
0 commit comments