Skip to content

Instantly share code, notes, and snippets.

@ukstudio
Created April 18, 2011 17:28
Show Gist options
  • Save ukstudio/925753 to your computer and use it in GitHub Desktop.
Save ukstudio/925753 to your computer and use it in GitHub Desktop.
CoffeeScript+QUnit
hello = -> 'hello'
var hello;
hello = function() {
return 'hello';
};
<!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>
test 'hello',->
equals 'hello', hello(), 'hello() is hello',
test('hello', function() {
return equals('hello', hello(), 'hello() is hello');
});
@trafnar
Copy link

trafnar commented Sep 20, 2011

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