Skip to content

Commit b03d4c8

Browse files
committed
[eslint] update no-redeclare
1 parent ef0069a commit b03d4c8

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

test/async-await.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -238,15 +238,13 @@ tap.test('async-error', function (t) {
238238
t.same(r.exitCode, 1);
239239

240240
var stderr = r.stderr.toString('utf8');
241-
var lines = stderr.split('\n');
242-
lines = lines.filter(function (line) {
241+
var stderrLines = stderr.split('\n').filter(function (line) {
243242
return !(/\(timers.js:/).test(line)
244243
&& !(/\(internal\/timers.js:/).test(line)
245244
&& !(/Immediate\.next/).test(line);
246245
});
247-
stderr = lines.join('\n');
248246

249-
t.same(stderr, '');
247+
t.same(stderrLines.join('\n'), '');
250248
t.end();
251249
});
252250
});

test/stackTrace.js

+9-12
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@ tap.test('preserves stack trace with newlines', function (tt) {
2828
});
2929

3030
stream.pipe(concat(function (body) {
31-
var body = body.toString('utf8');
32-
body = stripAt(body);
31+
var strippedBody = stripAt(body.toString('utf8'));
3332
tt.equal(
34-
body,
33+
strippedBody,
3534
'TAP version 13\n'
3635
+ '# multiline stack trace\n'
3736
+ 'not ok 1 Error: Preserve stack\n'
@@ -48,7 +47,7 @@ tap.test('preserves stack trace with newlines', function (tt) {
4847
+ '# fail 1\n'
4948
);
5049

51-
tt.deepEqual(getDiag(body), {
50+
tt.deepEqual(getDiag(strippedBody), {
5251
stack: stackTrace,
5352
operator: 'error'
5453
});
@@ -187,10 +186,9 @@ tap.test('preserves stack trace for failed assertions', function (tt) {
187186
});
188187

189188
stream.pipe(concat(function (body) {
190-
var body = body.toString('utf8');
191-
body = stripAt(body);
189+
var strippedBody = stripAt(body.toString('utf8'));
192190
tt.equal(
193-
body,
191+
strippedBody,
194192
'TAP version 13\n'
195193
+ '# t.equal stack trace\n'
196194
+ 'not ok 1 true should be false\n'
@@ -209,7 +207,7 @@ tap.test('preserves stack trace for failed assertions', function (tt) {
209207
+ '# fail 1\n'
210208
);
211209

212-
tt.deepEqual(getDiag(body), {
210+
tt.deepEqual(getDiag(strippedBody), {
213211
stack: stack,
214212
operator: 'equal',
215213
expected: false,
@@ -252,10 +250,9 @@ tap.test('preserves stack trace for failed assertions where actual===falsy', fun
252250
});
253251

254252
stream.pipe(concat(function (body) {
255-
var body = body.toString('utf8');
256-
body = stripAt(body);
253+
var strippedBody = stripAt(body.toString('utf8'));
257254
tt.equal(
258-
body,
255+
strippedBody,
259256
'TAP version 13\n'
260257
+ '# t.equal stack trace\n'
261258
+ 'not ok 1 false should be true\n'
@@ -274,7 +271,7 @@ tap.test('preserves stack trace for failed assertions where actual===falsy', fun
274271
+ '# fail 1\n'
275272
);
276273

277-
tt.deepEqual(getDiag(body), {
274+
tt.deepEqual(getDiag(strippedBody), {
278275
stack: stack,
279276
operator: 'equal',
280277
expected: true,

0 commit comments

Comments
 (0)