Skip to content

Commit

Permalink
Adds test for multihost
Browse files Browse the repository at this point in the history
  • Loading branch information
silentrob committed Jan 20, 2014
1 parent b90cef3 commit 7d61dbd
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 14 deletions.
64 changes: 50 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,55 @@
"description": "Static web server with built in preprocessing",
"author": "Brock Whitten <[email protected]>",
"contributors": [
{ "name": "Brock Whitten", "email": "[email protected]" },
{ "name": "Rob Ellis", "email": "[email protected]" },
{ "name": "Jorge Pedret", "email": "[email protected]" },
{ "name": "Michael Brooks", "email": "[email protected]" },
{ "name": "Tommy-Carlos Williams", "email": "[email protected]" },
{ "name": "Darryl Pogue", "email": "[email protected]" },
{ "name": "Boris Mann", "email": "[email protected]" },
{ "name": "Kenneth Ormandy", "email": "[email protected]" },
{ "name": "Keith Yao", "email": "[email protected]" },
{ "name": "Eric Drechsel", "email": "[email protected]" }
{
"name": "Brock Whitten",
"email": "[email protected]"
},
{
"name": "Rob Ellis",
"email": "[email protected]"
},
{
"name": "Jorge Pedret",
"email": "[email protected]"
},
{
"name": "Michael Brooks",
"email": "[email protected]"
},
{
"name": "Tommy-Carlos Williams",
"email": "[email protected]"
},
{
"name": "Darryl Pogue",
"email": "[email protected]"
},
{
"name": "Boris Mann",
"email": "[email protected]"
},
{
"name": "Kenneth Ormandy",
"email": "[email protected]"
},
{
"name": "Keith Yao",
"email": "[email protected]"
},
{
"name": "Eric Drechsel",
"email": "[email protected]"
}
],
"homepage": "http://harpjs.com",
"bugs": "http://github.com/sintaxi/harp/issues",
"main": "./lib/index.js",
"repository" : { "type" : "git", "url" : "https://github.com/sintaxi/harp.git" },
"dependencies":{
"repository": {
"type": "git",
"url": "https://github.com/sintaxi/harp.git"
},
"dependencies": {
"terraform": "0.6.2",
"commander": "2.0.0",
"connect": "2.9.0",
Expand All @@ -30,15 +63,18 @@
"devDependencies": {
"mocha": "1.8.1",
"should": "1.2.2",
"request": "2.30.0"
"request": "2.30.0",
"cheerio": "~0.13.1"
},
"scripts": {
"test": "mocha --reporter spec"
},
"license": "MIT",
"preferGlobal": true,
"readmeFilename": "README.md",
"bin": { "harp": "./bin/harp" },
"bin": {
"harp": "./bin/harp"
},
"engines": {
"node": ">=0.8"
}
Expand Down
31 changes: 31 additions & 0 deletions test/multihost.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
var should = require("should")
var request = require('request')
var path = require("path")
var fs = require("fs")
var exec = require("child_process").exec
var harp = require("../");
var cherio = require("cheerio");

describe("multihost", function(){

var projectPath = path.join(__dirname, "apps/multihost");
var port = 8104;
var $;

before(function(done){
harp.multihost(projectPath, { port: port }, function(errors){
done();
});
});

it("should return list of apps", function(done){
request("http://localhost:" + port + "/", function(e,r,b){
r.statusCode.should.eql(200)
$ = cherio.load(b);

$(".project-name").length.should.eql(2)
done();
});
});

});

0 comments on commit 7d61dbd

Please sign in to comment.