Created
August 8, 2013 07:08
-
-
Save kucherenko/6182242 to your computer and use it in GitHub Desktop.
Mocha in browser
This file contains 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
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Mocha Tests</title> | |
<link rel="stylesheet" href="lib/mocha/mocha.css" /> | |
<script src="lib/coffee-script.js"></script> | |
</head> | |
<body> | |
<div id="mocha"></div> | |
<script src="lib/mocha/mocha.js"></script> | |
<script src="http://chaijs.com/chai.js"></script> | |
<script>mocha.setup('bdd')</script> | |
<script type="text/coffeescript"> | |
chai.should() | |
sum = (a, b) -> a + b | |
describe "calculator test", -> | |
it "should summarize 2 numbers", -> | |
sum(1,2).should.be.equal 3 | |
</script> | |
<script type="text/coffeescript"> | |
mocha.checkLeaks() | |
mocha.run() | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment