forked from jamesshore/lets_code_javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_release_test.js
More file actions
37 lines (31 loc) · 970 Bytes
/
_release_test.js
File metadata and controls
37 lines (31 loc) · 970 Bytes
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
// Copyright (c) 2012 Titanium I.T. LLC. All rights reserved. See LICENSE.txt for details.
/*jshint regexp:false*/
(function() {
"use strict";
var jake = require("jake");
var child_process = require("child_process");
var http = require("http");
var fs = require("fs");
var procfile = require("procfile");
var child;
exports.test_isOnWeb = function(test) {
httpGet("http://weewikipaint.herokuapp.com", function(response, receivedData) {
var foundHomePage = receivedData.indexOf("WeeWikiPaint home page") !== -1;
test.ok(foundHomePage, "home page should have contained test marker");
test.done();
});
};
function httpGet(url, callback) {
var request = http.get(url);
request.on("response", function(response) {
var receivedData = "";
response.setEncoding("utf8");
response.on("data", function(chunk) {
receivedData += chunk;
});
response.on("end", function() {
callback(response, receivedData);
});
});
}
}());