Author: ygrego Date: 2015-02-19 14:05:34 +0000 (Thu, 19 Feb 2015) New Revision: 828 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/828 Log: Just return the evaluating between two elements for method "assertEquals" and the parameter for the methods "assertNotUndefined" and "assertNotNull". Modified: oipf/js/test/TestCase.js Modified: oipf/js/test/TestCase.js =================================================================== --- oipf/js/test/TestCase.js 2015-02-19 13:53:14 UTC (rev 827) +++ oipf/js/test/TestCase.js 2015-02-19 14:05:34 UTC (rev 828) @@ -9,52 +9,15 @@ }, assertNotUndefined : function(elmt) { - - try{ - if (elmt !== undefined) { - console.log("[INFO] Element are not undefined."); - return true; - } else { - throw new Error("The element is undefined."); - } - } catch (e) { - console.log(e); - return false; - - } - + return elmt; }, assertEquals: function(elmt1, elmt2) { - - try{ - if (elmt1 === elmt2) { - console.log("[INFO] Both elements are equals."); - return true; - } else { - throw new Error("Both elements are not equals."); - } - } catch (e) { - console.log(e); - return false; - - } + return elmt1 == elmt2; }, assertNotNull: function(elmt) { - - try{ - if (elmt !== null) { - console.log("[INFO] Element are not null."); - return true; - } else { - throw new Error("The element is null."); - } - } catch (e) { - console.log(e); - return false; - } - + return elmt; } });
participants (1)
-
ygregoï¼ users.nuiton.org