Skip to content

Instantly share code, notes, and snippets.

@mobz
Created May 6, 2012 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mobz/2621172 to your computer and use it in GitHub Desktop.
Save mobz/2621172 to your computer and use it in GitHub Desktop.
Standalone Test Runner for JSTestDriver
<!DOCTYPE html>
<html>
<head>
<title>Standalone JSTestRunner</title>
<!-- source scripts -->
<script src="../../main/webapp/www/core/jquery.js"></script>
<script src="../../main/webapp/www/core/core.js"></script>
<script src="../../main/webapp/www/core/widgets.js"></script>
<script>
(function() {
var global = this;
var tests = [];
global.TestCase = function() {
var t = function(){};
tests.push(t);
return t;
};
global.onload = function() {
tests.forEach( function( t ) {
suite = new t();
for( var test in suite ) {
try {
suite[test]();
} catch( e ) {
if( e.name === "AssertError" ) {
console.log(e.message);
console.log(e.stack);
} else {
console.log("Unexpected Error", e );
}
}
}
});
}
})();
</script>
<script src="lib/jshamcrest.js"></script>
<script src="lib/jsmockito.js"></script>
<script src="lib/mockAjax.js"></script>
<script src="plugin/jstd-plugins.js"></script>
<script src="src/www/core/core.js/i18nTest.js"></script>
</head>
<body></body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment