Closed GoogleCodeExporter closed 8 years ago
There should be
assertTrue(JastinValidator[validatorName](input) === expected);
instead of
assertTrue(JastinValidator[validatorName]() === expected);
Just made a mistake when preparing a test to paste here.
Original comment by enwukaer@gmail.com
on 14 May 2012 at 3:12
Please review how closures work. You are setting all the tests to the last test.
Original comment by corbinrs...@gmail.com
on 14 May 2012 at 5:53
Thanks for pointing it out! My friend helped me with the closures. The code
should look like this:
testCase.prototype[testName] = function (validatorName, expected) {
return function () {
console.log(validatorName);
assertTrue(JastinValidator[validatorName](input) === expected);
}
}(validatorName, expected);
Original comment by enwukaer@gmail.com
on 14 May 2012 at 6:42
Original issue reported on code.google.com by
enwukaer@gmail.com
on 14 May 2012 at 2:38