We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When running the following code, Mocha incorrectly detects global leaks on the variables "ctr", "username" and "email"
function test(){ this.ctr = typeof this.ctr !== 'undefined' ? this.ctr + 1 : 1; this.username = 'test_' + this.ctr; this.email = this.username + '@example.com'; return {ctr: this.ctr, name: this.username, email: this.email}; } describe('Global leak false positive', function(done){ it('gives a false positive detection of global leaks', function(done){ var x = test(); done(); }); });
environment mocha 1.12.0 node 0.10.20
The text was updated successfully, but these errors were encountered:
when you call test() there's no receiver, so it becomes the global. If you're expecting it to be mocha's Test object you'd have to do test.call(this)
test()
test.call(this)
Sorry, something went wrong.
No branches or pull requests
When running the following code, Mocha incorrectly detects global leaks on the variables "ctr", "username" and "email"
environment
mocha 1.12.0
node 0.10.20
The text was updated successfully, but these errors were encountered: