Live Unit Test Playground
Begin by writing a test, using Chai for assertions. You’ll see a red bar on the left of the test because it is (or should be) failing. Next, write some code to make the test pass and get a green bar. (NOTE: The red bar shows only for failing assertions and thrown exceptions.)
Tests and coverage are run live. Uncovered code is underlined.
Each test is independent. If you need some code to run before each test (e.g., data structure initialization), enter it in the “Before Each Test” box.
Use the keyboard to work fluidly:
Ctrl+Enter | Toggle between editor and tests
|
Shift+Enter | Add a new test, or, if the last test box is empty, jump to it
|
Shift+Delete | Delete the currently focused test (if any)
|
Tab and Shift+Tab | Navigate through tests
|
If the first line of a test is a comment, it will be used in the exported test script as the test’s description.