Skip to content

Commit

Permalink
sorting out the hapi tests #31
Browse files Browse the repository at this point in the history
  • Loading branch information
jackcarlisle committed Dec 8, 2015
1 parent 9f6afca commit 0a4e420
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion lib/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports.register = function(server, options, next) {

handler: {
directory:{
path: '../public',
path: 'public',
listing: true
}
}
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@
"babel-preset-stage-0": "^6.1.2",
"formsy-react": "^0.17.0",
"formsy-react-components": "^0.6.2",
"history": "^1.15.0",
"hapi": "^11.1.0",
"history": "^1.14.0",
"hapi": "^11.1.0",
"hoek": "^3.0.1",
"inert": "^3.2.0",
"jsx-loader": "^0.13.2",
Expand Down
28 changes: 14 additions & 14 deletions test/hapi-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ var test = require('tape');
var start = require('../lib/start.js');
var server = require("../lib/index.js"); // our index.js from above

// test("simple server running", function(t) { // t
// var options = {
// method: "GET",
// url: "/"
// };
// // server.inject lets you similate an http request
// server.inject(options, function(response) {
// t.equal(response.statusCode, 200, "200 status code returned"); // Expect http response status code to be 200 ("Ok")
// setTimeout(function(){
// server.stop(t.end); // t.end() callback is required to end the test in tape
// },2000);
// });
//
// });
test("simple server running", function(t) { // t
var options = {
method: "GET",
url: "/"
};
// server.inject lets you similate an http request
server.inject(options, function(response) {
t.equal(response.statusCode, 200, "200 status code returned"); // Expect http response status code to be 200 ("Ok")
// setTimeout(function(){
server.stop(t.end); // t.end() callback is required to end the test in tape
// },2000);
});

});

test("public served", function(t) { // t
var options = {
Expand Down

0 comments on commit 0a4e420

Please sign in to comment.