Skip to content

Commit 452da72

Browse files
authoredSep 1, 2016
fix tests for Node v6.5.0 (#87)
1 parent 4978bdd commit 452da72

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed
 

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"hoek": "4.x.x"
1717
},
1818
"devDependencies": {
19-
"lab": "10.x.x",
19+
"lab": "11.x.x",
2020
"markdown-toc": "0.12.x"
2121
},
2222
"scripts": {

‎test/index.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -667,14 +667,15 @@ describe('expect()', () => {
667667
exception = err;
668668
}
669669

670-
Hoek.assert(exception.message === 'Expected {} to be an error with Error type', exception);
670+
Hoek.assert(/Expected (Custom )?{} to be an error with Error type/.test(exception.message), exception);
671671
done();
672672
});
673673

674674
it('invalidates assertion (anonymous type)', (done) => {
675675

676676
const Custom = function () { };
677677
Hoek.inherits(Custom, Error);
678+
delete Custom.name; // Ensure that the type is anonymous
678679

679680
let exception = false;
680681
try {
@@ -1938,6 +1939,7 @@ describe('expect()', () => {
19381939
it('invalidates assertion (anonymous)', (done) => {
19391940

19401941
const Custom = function () { };
1942+
delete Custom.name; // Ensure that the type is anonymous
19411943

19421944
let exception = false;
19431945
try {
@@ -2257,6 +2259,7 @@ describe('expect()', () => {
22572259
it('invalidates assertion (anonymous type)', (done) => {
22582260

22592261
const Custom = function () { };
2262+
delete Custom.name; // Ensure that the type is anonymous
22602263

22612264
let exception = false;
22622265
try {
@@ -2266,7 +2269,7 @@ describe('expect()', () => {
22662269
exception = err;
22672270
}
22682271

2269-
Hoek.assert(exception.message === 'Expected [Function] to throw provided type', exception);
2272+
Hoek.assert(/Expected \[Function(: throws)?\] to throw provided type/.test(exception.message), exception);
22702273
done();
22712274
});
22722275

0 commit comments

Comments
 (0)
Please sign in to comment.