UNPKG

easy-bake

Version:

EasyBake provides an efficient environment for CoffeeScript library developers: CoffeeScript/Javascript-based configuration files (no coding needed), workflow (build, watch, clean, preview) tests (QUnit, Jasime, NodeUnit, server-side emulation with ModuleBundler), publishing (git, npm, NuGet). Replace your Cakefile with a Bakefile today!

66 lines (63 loc) 1.96 kB
// Generated by CoffeeScript 1.6.3 (function() { var args, e, page, page_filename, silent, start, timeout; try { args = phantom.args; if (args.length < 1 || args.length > 3) { console.log("Usage: " + phantom.scriptName + " <URL> <timeout> <silent>"); phantom.exit(1); } page_filename = args[0]; timeout = parseInt(args[1], 10) || 60000; silent = args.length >= 2 ? !!args[2] : false; start = Date.now(); page = require('webpage').create(); page.onConsoleMessage = function(msg) { if (msg.indexOf('warning') !== 0) { return console.log(msg); } }; page.open(page_filename, function(status) { var interval; if (status !== 'success') { console.error("Unable to access network"); return phantom.exit(1); } else { return interval = setInterval((function() { var code, stats; if (Date.now() > start + timeout) { console.error("Tests timed out"); return phantom.exit(124); } else { stats = page.evaluate(function() { var runner; runner = jasmine.getEnv().currentRunner(); console.log('current runner'); if (runner.queue.isRunning()) { return; } return runner.results(); }); if (!stats) { return; } clearInterval(interval); if (stats.totalCount <= 0) { phantom.exit(-1); return; } code = stats.failedCount > 0 ? 1 : 0; if (!silent) { console.log("phantomjs-jasmine-runner.js: exiting (" + code + ")"); } return phantom.exit(code); } }), 500); } }); } catch (_error) { e = _error; console.error("Jasmine exception: " + e); phantom.exit(1); } }).call(this);