-
Notifications
You must be signed in to change notification settings - Fork 201
/
Copy pathcombobuild.js
41 lines (31 loc) · 879 Bytes
/
combobuild.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* grunt
* http://gruntjs.com/
*
* Copyright (c) 2012 "Cowboy" Ben Alman
* Licensed under the MIT license.
* https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT
*/
/*global phantom:true*/
var fs = require('fs');
// The buil .html test file to run.
var url = phantom.args[0];
// Keep track of the last time a QUnit message was sent.
var last = new Date();
// Messages are sent to the parent by appending them to the tempfile.
function sendMessage(args) {
console.log(JSON.stringify(args))
//fs.write(tmpfile, JSON.stringify(args) + '\n', 'a');
// Exit when all done.
phantom.exit();
}
setInterval(function() {
sendMessage(['done_timeout']);
}, 5000);
// Create a new page.
var page = require('webpage').create();
// QUnit sends its messages via alert(jsonstring);
page.onAlert = function(args) {
sendMessage(JSON.parse(args));
};
page.open(url);