Created
August 11, 2013 16:01
-
-
Save zilti/6205472 to your computer and use it in GitHub Desktop.
Files for the https://coderwall.com/p/-sawaa protip.
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
Files for the https://coderwall.com/p/-sawaa protip. |
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><title>Tests</title> | |
</head> | |
<body> | |
<script type="text/javascript" src="tests.js"></script> | |
</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
var page = require('webpage').create(); | |
var url = phantom.args[0]; | |
page.onConsoleMessage = function (message) { | |
console.log("Test console: " + message); | |
}; | |
console.log("Loading URL: " + url); | |
page.open(url, function (status) { | |
if (status != "success") { | |
console.log('Failed to open ' + url); | |
phantom.exit(1); | |
} | |
console.log("Running test."); | |
var result = page.evaluate(function() { | |
specljs.run.standard.armed = true; | |
return specljs.run.standard.run_specs( | |
cljs.core.keyword("color"), true | |
); | |
}); | |
if (result != 0) { | |
console.log("*** Test failed! ***"); | |
phantom.exit(1); | |
} | |
console.log("Test succeeded."); | |
phantom.exit(0); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment