Skip to content

Commit e697029

Browse files
committed
minor fixups
1 parent feef1bd commit e697029

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

lib/test.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,15 @@ Object.keys(assert).forEach(function (el) {
8383
});
8484

8585
Test.prototype._setAssertError = function (err) {
86-
if (this.assertError === undefined) {
87-
if (err === undefined) {
88-
err = 'undefined';
89-
}
90-
this.assertError = err;
86+
if (this.assertError !== undefined) {
87+
return;
9188
}
89+
90+
if (err === undefined) {
91+
err = 'undefined';
92+
}
93+
94+
this.assertError = err;
9295
};
9396

9497
// Workaround for power-assert

test/test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ test('wait for test to end', function (t) {
313313
}, 1234);
314314
});
315315

316-
test('promise is rejected with the first assertError', function (t) {
316+
test('fails with the first assertError', function (t) {
317317
ava(function (a) {
318318
a.plan(2);
319319
a.is(1, 2);
@@ -325,7 +325,7 @@ test('promise is rejected with the first assertError', function (t) {
325325
});
326326
});
327327

328-
test('promise is rejected with thrown falsie value', function (t) {
328+
test('fails with thrown falsie value', function (t) {
329329
ava(function () {
330330
throw 0; // eslint-disable-line no-throw-literal
331331
}).run().catch(function (err) {

0 commit comments

Comments
 (0)