Fix #317

That test fails only when `mocha.checkLeaks` is called in browsers so I didn't commit new tests.