Fix ReferenceError in js tests, fixes #6542
Merge pull request #6584 from jhamrick/fix-js-tests

Fix ReferenceError in js tests