Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Files for the https://coderwall.com/p/-sawaa protip.
Files for the https://coderwall.com/p/-sawaa protip.
<!DOCTYPE html>
<html><head><title>Tests</title>
</head>
<body>
<script type="text/javascript" src="tests.js"></script>
</body>
</html>
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