Fix JavaScript unit tests.

Some older changes broke JavaScript unit tests. The changes themselves
were fine, but the unit tests weren't updated to match new behavior.
This fixes them so that we're back to all tests passing.