Fix env test to check for proper exception

The test didn't check for what it actually wanted to test. The contained
code did actually throw, however that was only the case, because jsdom
was undefined, instead of a thrown error by jsdom.env.