Skip to content
New issue

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

Fix leaking variable in tests #488

Merged
merged 2 commits into from
Dec 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{
"root": true,
"env": {
"browser": true,
"node": true,
},
"globals": {
"Promise": false,
},
"rules": {
"indent": ["error", 4],
"key-spacing": "error",
Expand All @@ -8,6 +15,7 @@
"anonymous": "always",
"named": "never",
}],
"no-undef": "error",
},
"overrides": [
{
Expand All @@ -16,5 +24,11 @@
"ecmaVersion": 2017,
},
},
{
"files": ["example/**", "test/**"],
"globals": {
"g": false,
},
},
],
}
4 changes: 2 additions & 2 deletions test/promise_fail.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tap.test('callback returning rejected promise should cause that test (and only t
return tt.pass('the test file indicated it should be skipped');
}

strippedString = stripFullStack(rowsString);
var strippedString = stripFullStack(rowsString);

// hack for consistency across all versions of node
// some versions produce a longer stack trace for some reason
Expand Down Expand Up @@ -60,7 +60,7 @@ tap.test('subtest callback returning rejected promise should cause that subtest
return tt.pass('the test file indicated it should be skipped');
}

strippedString = stripFullStack(rowsString);
var strippedString = stripFullStack(rowsString);

// hack for consistency across all versions of node
// some versions produce a longer stack trace for some reason
Expand Down
4 changes: 2 additions & 2 deletions test/stackTrace.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ tap.test('preserves stack trace for failed assertions', function (tt) {
parser.once('assert', function (data) {
tt.equal(typeof data.diag.at, 'string');
tt.equal(typeof data.diag.stack, 'string');
at = data.diag.at || '';
var at = data.diag.at || '';
stack = data.diag.stack || '';
tt.ok(/^Error: true should be false(\n at .+)+/.exec(stack), 'stack should be a stack');
tt.deepEqual(data, {
Expand Down Expand Up @@ -172,7 +172,7 @@ tap.test('preserves stack trace for failed assertions where actual===falsy', fun
parser.once('assert', function (data) {
tt.equal(typeof data.diag.at, 'string');
tt.equal(typeof data.diag.stack, 'string');
at = data.diag.at || '';
var at = data.diag.at || '';
stack = data.diag.stack || '';
tt.ok(/^Error: false should be true(\n at .+)+/.exec(stack), 'stack should be a stack');
tt.deepEqual(data, {
Expand Down