Unit Tests
Explore how to create simple, effective unit tests for autovalidating forms in JavaScript. Understand test structures, input-output expectations, and how to display test results on a web page without using assert, enhancing your debugging process.
We'll cover the following...
We'll cover the following...
Unit tests should be straightforward and answer, “given these inputs, what are the expected outputs.”
assert is a Node thing, which, as its name indicates, checks that the argument evaluates to true and throws an error if it’s not.
We’ve structured our tests such that there’s a runner ...