54 lines
2.2 KiB
Diff
54 lines
2.2 KiB
Diff
commit 3c5b085ca59478b68f6fa0d9425405b68104b5ac
|
|
Author: Tom Hughes <tom@compton.nu>
|
|
Date: Sat Nov 21 12:24:47 2015 +0000
|
|
|
|
Fix tests for newer versions of should
|
|
|
|
diff --git a/test/test-bettererrors.js b/test/test-bettererrors.js
|
|
index 35ac798..dc05e8f 100644
|
|
--- a/test/test-bettererrors.js
|
|
+++ b/test/test-bettererrors.js
|
|
@@ -15,9 +15,9 @@ function betterErrorStringFromError(error) {
|
|
}
|
|
|
|
function performBasicChecks(betterErrorString) {
|
|
- betterErrorString.should.include("AssertionError");
|
|
- betterErrorString.should.include("test-bettererrors");
|
|
- //betterErrorString.should.not.include("undefined");
|
|
+ betterErrorString.should.containEql("AssertionError");
|
|
+ betterErrorString.should.containEql("test-bettererrors");
|
|
+ //betterErrorString.should.not.containEql("undefined");
|
|
}
|
|
|
|
/**
|
|
@@ -30,9 +30,9 @@ exports.testEqual = function (test) {
|
|
} catch (error) {
|
|
var betterErrorString = betterErrorStringFromError(error);
|
|
performBasicChecks(betterErrorString);
|
|
- betterErrorString.should.include("true");
|
|
- betterErrorString.should.include("false");
|
|
- betterErrorString.should.include("==");
|
|
+ betterErrorString.should.containEql("true");
|
|
+ betterErrorString.should.containEql("false");
|
|
+ betterErrorString.should.containEql("==");
|
|
test.done();
|
|
}
|
|
};
|
|
@@ -66,11 +66,11 @@ exports.testErrorIsNotAssertion = function (test) {
|
|
throw new Error("test error");
|
|
} catch (error) {
|
|
var betterErrorString = betterErrorStringFromError(error);
|
|
- betterErrorString.should.not.include("AssertionError");
|
|
- betterErrorString.should.include("Error");
|
|
- betterErrorString.should.include("test error");
|
|
- betterErrorString.should.include("test-bettererrors");
|
|
- betterErrorString.should.not.include("undefined");
|
|
+ betterErrorString.should.not.containEql("AssertionError");
|
|
+ betterErrorString.should.containEql("Error");
|
|
+ betterErrorString.should.containEql("test error");
|
|
+ betterErrorString.should.containEql("test-bettererrors");
|
|
+ betterErrorString.should.not.containEql("undefined");
|
|
test.done();
|
|
}
|
|
};
|