From 3acabec4752f6ccb07a63572e3b087f4adc5fea0 Mon Sep 17 00:00:00 2001 From: jobala Date: Wed, 1 Feb 2017 20:34:11 +0300 Subject: [PATCH 1/7] test: add regex --- test/parallel/test-assert.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js index 8cba5ed517aa16..2ca3f478d254d2 100644 --- a/test/parallel/test-assert.js +++ b/test/parallel/test-assert.js @@ -378,7 +378,7 @@ try { assert.strictEqual(true, threw, 'a.doesNotThrow is not catching type matching errors'); -assert.throws(function() { assert.ifError(new Error('test error')); }); +assert.throws(function() { assert.ifError(new Error('test error')), /^([A-Za-z])\w+$/}); assert.doesNotThrow(function() { assert.ifError(null); }); assert.doesNotThrow(function() { assert.ifError(); }); From 8870c7f9cd814e8c177bc17739c5521517cff32f Mon Sep 17 00:00:00 2001 From: jobala Date: Mon, 6 Feb 2017 13:15:12 +0300 Subject: [PATCH 2/7] test: verify error message thrown from assert.ifError --- test/parallel/test-assert.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js index 2ca3f478d254d2..ce51727a835e26 100644 --- a/test/parallel/test-assert.js +++ b/test/parallel/test-assert.js @@ -378,7 +378,7 @@ try { assert.strictEqual(true, threw, 'a.doesNotThrow is not catching type matching errors'); -assert.throws(function() { assert.ifError(new Error('test error')), /^([A-Za-z])\w+$/}); +assert.throws(function() { assert.ifError(new Error('test error')), /^Error: test error/}); assert.doesNotThrow(function() { assert.ifError(null); }); assert.doesNotThrow(function() { assert.ifError(); }); From ac29f57c7c6ea26ea6fc20a39ad045466f26f8a2 Mon Sep 17 00:00:00 2001 From: jobala Date: Mon, 6 Feb 2017 17:22:57 +0300 Subject: [PATCH 3/7] test: make regex the second argument of assert.throws --- test/parallel/test-assert.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js index ce51727a835e26..bd3dcdfd669d33 100644 --- a/test/parallel/test-assert.js +++ b/test/parallel/test-assert.js @@ -378,7 +378,7 @@ try { assert.strictEqual(true, threw, 'a.doesNotThrow is not catching type matching errors'); -assert.throws(function() { assert.ifError(new Error('test error')), /^Error: test error/}); +assert.throws(function() { assert.ifError(new Error('test error'))}, /^Error: test error$/); assert.doesNotThrow(function() { assert.ifError(null); }); assert.doesNotThrow(function() { assert.ifError(); }); From 691ce1c6cc00b0f929baba8494079fda0603ef6f Mon Sep 17 00:00:00 2001 From: jobala Date: Mon, 6 Feb 2017 17:34:36 +0300 Subject: [PATCH 4/7] test: add space before curly brace --- test/parallel/test-assert.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js index bd3dcdfd669d33..08b22cf17a5b65 100644 --- a/test/parallel/test-assert.js +++ b/test/parallel/test-assert.js @@ -378,7 +378,7 @@ try { assert.strictEqual(true, threw, 'a.doesNotThrow is not catching type matching errors'); -assert.throws(function() { assert.ifError(new Error('test error'))}, /^Error: test error$/); +assert.throws(function() { assert.ifError(new Error('test error')); }, /^Error: test error$/); assert.doesNotThrow(function() { assert.ifError(null); }); assert.doesNotThrow(function() { assert.ifError(); }); From 25527ff936648e36c8525bd72db990cc8a2ad9b0 Mon Sep 17 00:00:00 2001 From: jobala Date: Tue, 7 Feb 2017 13:09:45 +0300 Subject: [PATCH 5/7] test: fix exceed maximum lenghth lint error --- test/parallel/test-assert.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js index 08b22cf17a5b65..22e8ec7385b22c 100644 --- a/test/parallel/test-assert.js +++ b/test/parallel/test-assert.js @@ -378,7 +378,8 @@ try { assert.strictEqual(true, threw, 'a.doesNotThrow is not catching type matching errors'); -assert.throws(function() { assert.ifError(new Error('test error')); }, /^Error: test error$/); +assert.throws(function() { assert.ifError(new Error('test error')); }, + /^Error: test error$/); assert.doesNotThrow(function() { assert.ifError(null); }); assert.doesNotThrow(function() { assert.ifError(); }); From a7a57e3d5c82e27d6a6d36931b2bbbb5a614f069 Mon Sep 17 00:00:00 2001 From: jobala Date: Tue, 7 Feb 2017 13:09:45 +0300 Subject: [PATCH 6/7] test: fix exceed maximum line length lint error --- test/parallel/test-assert.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js index 08b22cf17a5b65..22e8ec7385b22c 100644 --- a/test/parallel/test-assert.js +++ b/test/parallel/test-assert.js @@ -378,7 +378,8 @@ try { assert.strictEqual(true, threw, 'a.doesNotThrow is not catching type matching errors'); -assert.throws(function() { assert.ifError(new Error('test error')); }, /^Error: test error$/); +assert.throws(function() { assert.ifError(new Error('test error')); }, + /^Error: test error$/); assert.doesNotThrow(function() { assert.ifError(null); }); assert.doesNotThrow(function() { assert.ifError(); }); From ccab05808371e6512fb5430890ddd7c2c3caea56 Mon Sep 17 00:00:00 2001 From: jobala Date: Wed, 8 Feb 2017 10:20:54 +0300 Subject: [PATCH 7/7] test: fix indentation lint error --- test/parallel/test-assert.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js index 22e8ec7385b22c..ff2c3f1e3f2d37 100644 --- a/test/parallel/test-assert.js +++ b/test/parallel/test-assert.js @@ -379,7 +379,7 @@ assert.strictEqual(true, threw, 'a.doesNotThrow is not catching type matching errors'); assert.throws(function() { assert.ifError(new Error('test error')); }, - /^Error: test error$/); + /^Error: test error$/); assert.doesNotThrow(function() { assert.ifError(null); }); assert.doesNotThrow(function() { assert.ifError(); });