Skip to content

Instantly share code, notes, and snippets.

@robertovg
Created August 12, 2013 11:53
Show Gist options
  • Save robertovg/6210224 to your computer and use it in GitHub Desktop.
Save robertovg/6210224 to your computer and use it in GitHub Desktop.
mochaPhantomJS-runner
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Title &amp; Meta -->
<title>Frontend tests</title>
<meta charset="utf-8">
<!-- Stylesheets -->
<link rel="stylesheet" href="lib/mocha/mocha.css">
</head>
<body>
<div id="mocha"></div>
<!-- Testing Libraries -->
<script src="lib/mocha/mocha.js"></script>
<script src="lib/chai/chai.js"></script>
<script src="lib/sinon/sinon.js"></script>
<script>
// Use the expect version of chai assertions - http://chaijs.com/api/bdd
chai.should();
// Tell mocha we want TDD syntax
mocha.setup('bdd');
</script>
<!-- Libs -->
<script src="../lib/jquery/jquery.js"></script>
<script src="../lib/underscore/underscore.js"></script>
<script src="../lib/backbone/backbone.js"></script>
<!-- Source files -->
<script src="../src/"></script>
<!-- Test -->
<script src="models/userBDD.test.js"></script>
<script>
if (window.mochaPhantomJS) {
mochaPhantomJS.run();
}else {
mocha.run();
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment