Skip to content

Commit

Permalink
fix tests for Node v6.5.0 (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
cjihrig authored Sep 1, 2016
1 parent 4978bdd commit 452da72
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"hoek": "4.x.x"
},
"devDependencies": {
"lab": "10.x.x",
"lab": "11.x.x",
"markdown-toc": "0.12.x"
},
"scripts": {
Expand Down
7 changes: 5 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -667,14 +667,15 @@ 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();
});

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

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

let exception = false;
try {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand All @@ -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();
});

Expand Down

0 comments on commit 452da72

Please sign in to comment.