Created
April 18, 2011 17:28
-
-
Save ukstudio/925753 to your computer and use it in GitHub Desktop.
CoffeeScript+QUnit
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
hello = -> 'hello' |
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
var hello; | |
hello = function() { | |
return 'hello'; | |
}; |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> | |
<meta http-equiv="Content-Style-Type" content="text/css" /> | |
<meta http-equiv="Content-Script-Type" content="text/javascript" /> | |
<title>QUnit Test Suite</title> | |
<link rel="stylesheet" href="qunit/qunit.css" /> | |
<script type="text/javascript" src="qunit/qunit.js"></script> | |
<script type="text/javascript" src="../src/hello.js"></script> | |
<script type="text/javascript" src="src/test-hello.js"></script> | |
</head> | |
<body> | |
<h1 id="qunit-header">QUnit Test Suite</h1> | |
<h2 id="qunit-banner"></h2> | |
<div id="qunit-testrunner-toolbar"></div> | |
<h2 id="qunit-userAgent"></h2> | |
<ol id="qunit-tests"></ol> | |
</body> | |
</html> | |
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
test 'hello',-> | |
equals 'hello', hello(), 'hello() is hello', |
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
test('hello', function() { | |
return equals('hello', hello(), 'hello() is hello'); | |
}); |
I had trouble making this work until I realized I needed to use the --bare flag when compiling my coffee files.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome, thank you.