From 452da72498dc236467e610ec68bc6c2b44c12595 Mon Sep 17 00:00:00 2001 From: Colin Ihrig Date: Thu, 1 Sep 2016 12:01:31 -0400 Subject: [PATCH] fix tests for Node v6.5.0 (#87) --- package.json | 2 +- test/index.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index a205de4..f08c48c 100755 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "hoek": "4.x.x" }, "devDependencies": { - "lab": "10.x.x", + "lab": "11.x.x", "markdown-toc": "0.12.x" }, "scripts": { diff --git a/test/index.js b/test/index.js index ce62179..dc2addb 100755 --- a/test/index.js +++ b/test/index.js @@ -667,7 +667,7 @@ describe('expect()', () => { exception = err; } - Hoek.assert(exception.message === 'Expected {} to be an error with Error type', exception); + Hoek.assert(/Expected (Custom )?{} to be an error with Error type/.test(exception.message), exception); done(); }); @@ -675,6 +675,7 @@ describe('expect()', () => { const Custom = function () { }; Hoek.inherits(Custom, Error); + delete Custom.name; // Ensure that the type is anonymous let exception = false; try { @@ -1938,6 +1939,7 @@ describe('expect()', () => { it('invalidates assertion (anonymous)', (done) => { const Custom = function () { }; + delete Custom.name; // Ensure that the type is anonymous let exception = false; try { @@ -2257,6 +2259,7 @@ describe('expect()', () => { it('invalidates assertion (anonymous type)', (done) => { const Custom = function () { }; + delete Custom.name; // Ensure that the type is anonymous let exception = false; try { @@ -2266,7 +2269,7 @@ describe('expect()', () => { exception = err; } - Hoek.assert(exception.message === 'Expected [Function] to throw provided type', exception); + Hoek.assert(/Expected \[Function(: throws)?\] to throw provided type/.test(exception.message), exception); done(); });