Skip to content

Instantly share code, notes, and snippets.

@ojii
Created August 14, 2012 13:40
Show Gist options
  • Save ojii/3349343 to your computer and use it in GitHub Desktop.
Save ojii/3349343 to your computer and use it in GitHub Desktop.
phantomjs qunit

For this example

  • install phantomjs
  • install twisted
  • make an empty directory
  • download qunit.js and qunit.css into that directory
  • download https://github.com/ariya/phantomjs/blob/1.2/examples/run-qunit.js into that directory
  • add index.html and tests.js from below to that directory
  • run twistd web --path=. --port=8080 && phantomjs run-qunit.js http://localhost:8080 && kill `cat twistd.pid`
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>QUnit Example</title>
<link rel="stylesheet" href="/qunit.css">
</head>
<body>
<div id="qunit"></div>
<script src="/qunit.js"></script>
<script src="/tests.js"></script>
</body>
</html>
test( "hello test", function() {
ok( 1 == "1", "Passed!" );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment