I'm following along with Test Driven Javascript Development and just finshed setting up jstestdriver. I'm receiving odd errors and failed test messages when running failing tests, for example:
TestCase("ArrayTest", {
"test array splice should not modify array": function () {
var arr = [1, 2, 3, 4, 5];
var result = arr.splice(2, 3);
assertEquals([1, 2, 3, 4, 5], arr);
}
});
My failed test output is fairly succinct and includes an odd FailureException error:
F
Total 1 tests (Passed: 0; Fails: 1; Errors: 0) (3.00 ms)
Chrome 27.0.1453.116 Mac OS: Run 1 tests (Passed: 0; Fails: 1; Errors 0) (3.00 ms)
ArrayTest.test array splice should not modify array failed (3.00 ms):
null
com.google.jstestdriver.FailureException
at com.google.jstestdriver.FailureCheckerAction.run(Unknown Source)
at com.google.jstestdriver.ActionRunner.runActions(Unknown Source)
at com.google.jstestdriver.JsTestDriverServer.main(Unknown Source)
I would like to know if it's possible to fix that failure exception, and also receive a message such as “expected [1, 2, 3, 4, 5] but was [1, 2]", as the book mentions you should receive.