Skip to content

Commit 72e77c6

Browse files
Document more about testing
Signed-off-by: David A. Wheeler <[email protected]>
1 parent 4614921 commit 72e77c6

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

docs/labs/create_checker.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -474,28 +474,44 @@ As always, it's best to try to
474474
make smaller changes, test them, and once they work
475475
check them in. That way you won't need to debug a long complicated
476476
set 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

478485
Please create tests! You can create test cases for attempts
479486
(`successes` should pass, `failures` should fail), and test cases
480487
to ensure the hints work correctly.
481-
Remember, hints are checked in order - it's possible to create a hint
488+
Hints are checked in order - it's possible to create a hint
482489
that won't trigger because something earlier would always match.
483490
These tests are automatically checked every time the page is (re)loaded.
484491

492+
The script `mass-test` for Linux or MacOS will automatically open
493+
every lab in your default browser's current window.
494+
This will rerun all our lab automated tests.
495+
If every lab has a yellow text entry area, and doesn't show test failure
496+
alerts, then all the labs pass the test.
497+
485498
### Debugging
486499

487500
Sadly, sometimes things don't work; here are some debugging tips for labs.
488501

489-
Every time you reload the lab HTML, the program will reload and
490-
all self-tests will be run. If you see no errors, and the text entry
491-
areas are showing in yellow, a *lot* of things are working well.
492-
493502
If you load a page and the text entries don't have color, there
494503
was a serious problem loading things.
495504
Use your browser's *Developer Tools* to show details.
496505
In Chrome, this is More Tools -> Developer Tools -> (Console Tab).
497506
In Firefox, this is More Tools -> Web Developer Tools -> (Console Tab).
498507
You may need to further open specifics to see them.
508+
Often the problem is that (1) a line just before added material needs a
509+
trailing comma, or (2) a string was not properly closed (e.g.,
510+
it is double-quoted but includes double-quote that was not properly escaped).
511+
512+
If the JavaScript loads successfully, but then a self-test fails,
513+
you'll see alert box(es) telling you which tests failed.
514+
See [testing](#testing).
499515

500516
Note:
501517

0 commit comments

Comments
 (0)