Created
August 17, 2011 12:47
-
-
Save jkamenik/1151464 to your computer and use it in GitHub Desktop.
JS Unit Testing using YUI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<input onclick="javascript:runAllTests()" type="button" value="Run Tests" /> | |
<script> | |
new YAHOO.tool.TestLogger(); | |
function runAllTests(){ | |
YAHOO.tool.TestRunner.run(); | |
} | |
</script> | |
</body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="stylesheet" type="text/css" href="logger.css"> | |
<link rel="stylesheet" type="text/css" href="testlogger.css"> | |
<!-- Test runner code --> | |
<script src="yahoo-dom-event.js"></script> | |
<script src="logger.js"></script> | |
<script src="yuitest.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var assert = YAHOO.util.Assert; | |
YAHOO.tool.TestRunner.add(new YAHOO.tool.TestCase({ | |
name: 'Tests for string', | |
test_true: function(){ | |
var test = String(true); | |
assert.isString(test); | |
assert.areEqual('true',test); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment