1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-16 18:53:31 +01:00

More testing stuff.

This commit is contained in:
Kris Maglione
2011-02-03 05:17:02 -05:00
parent b10e4e4b3a
commit 11a6a7a31b
3 changed files with 89 additions and 21 deletions

View File

@@ -23,12 +23,16 @@ function wrapAssertNoErrors(func, message) {
function assertMessage(funcName, want, got, message) {
if (typeof want === "string")
return utils.assertEqual(funcName, want, got, message);
else if (typeof want === "function")
return utils.test(want(got), {
else if (typeof want === "function") {
var res = want(got);
if (res === undefined)
return true;
return utils.test(res, {
function: funcName,
want: want, got: got,
comment: message
});
}
else
return utils.test(want.test(got), {
function: funcName,