Open fatso83 opened 8 years ago
I am a bot that watches issues for inactivity.
This issue hasn't had any recent activity, and I'm labeling it stale
. In 14 days, if there are no further comments or activity, I will close this issue.
Thanks for contributing to Mocha!
This behavior is still present; doesn't have anything to do with adding or removing var
, it's just that after the assignment of the global in the first run, subsequent runs don't detect the assignment because Mocha's global leak detection specifically ignores globals that were already there before the test started.
I don't know if there's a reasonable fix for that, however.
I think adding reset logic (always set to first runtime global variables) to the lib\cli\watch-run.js
will be able to detect it properly every run on watch mode.
I have the following bit of code, for which mocha correctly detects a leak:
By substituting 'x' for 'var x' the test passes. Seemingly, the same applies when running mocha with the --watch task, but when I remove the
var
statement the test still passes without any error about leaking. This is a bug.Using mocha 2.3.3 on Node 4.2.1