Skip to content

Instantly share code, notes, and snippets.

@wilsonpage
Forked from Raynos/moduleA.test.js
Created November 21, 2011 17:09
Show Gist options
  • Save wilsonpage/1383264 to your computer and use it in GitHub Desktop.
Save wilsonpage/1383264 to your computer and use it in GitHub Desktop.
define(['moduleA.js'], function(ModuleA){
return {
"test1": function (test) {
// run test on ModuleA
},
"test2": function (test) {
// run test on ModuleA
},
"test3": function (test) {
// run test on ModuleA
}
};
});
<!DOCTYPE html>
<html>
<head>
<title>My unit tests!</title>
<link rel="stylesheet" href="resources/nodeunit.css" type="text/css" />
<script src="resources/es5-shim.js"></script>
<script src="resources/nodeunit.js"></script>
</head>
<body>
<h1 id="nodeunit-header">You win!</h1>
<script>
require([
"moduleA.test.js",
"moduleB.test.js",
...
], function () {
[].forEach.call(arguments, function (suite) {
nodeunit.run(suite);
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment