Skip to content

Commit

Permalink
node v6
Browse files Browse the repository at this point in the history
  • Loading branch information
hueniverse committed May 21, 2016
1 parent 78e7de3 commit 86642f2
Show file tree
Hide file tree
Showing 16 changed files with 89 additions and 90 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ language: node_js

node_js:
- "4"
- "5"
- "6"

sudo: false
38 changes: 19 additions & 19 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "hapi",
"description": "HTTP Server framework",
"homepage": "http://hapijs.com",
"version": "13.4.0",
"version": "13.4.1",
"repository": {
"type": "git",
"url": "git://github.com/hapijs/hapi"
Expand Down Expand Up @@ -39,9 +39,9 @@
"topo": "2.x.x"
},
"devDependencies": {
"code": "2.x.x",
"code": "3.x.x",
"handlebars": "4.x.x",
"inert": "3.x.x",
"inert": "4.x.x",
"lab": "10.x.x",
"vision": "4.x.x",
"wreck": "7.x.x"
Expand Down
4 changes: 2 additions & 2 deletions test/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ describe('authentication', () => {
server.auth.strategy('default', 'custom', { users: { steve: {} } });

server.auth.default('default');
expect(server.connections[0].auth.settings.default).to.deep.equal({ strategies: ['default'], mode: 'required' });
expect(server.connections[0].auth.settings.default).to.equal({ strategies: ['default'], mode: 'required' });

const handler = function (request, reply) {

Expand Down Expand Up @@ -393,7 +393,7 @@ describe('authentication', () => {
server.inject({ url: '/', headers: { authorization: 'Custom steve' } }, (res) => {

expect(res.statusCode).to.equal(200);
expect(res.result).to.deep.equal({
expect(res.result).to.equal({
strategies: ['default'],
mode: 'required'
});
Expand Down
13 changes: 6 additions & 7 deletions test/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('Connection', () => {

const server = new Hapi.Server();
server.connection({ labels: ['a', 'b', 'a', 'c', 'b'] });
expect(server.connections[0].settings.labels).to.deep.equal(['a', 'b', 'c']);
expect(server.connections[0].settings.labels).to.equal(['a', 'b', 'c']);
done();
});

Expand Down Expand Up @@ -586,8 +586,7 @@ describe('Connection', () => {
server.stop({ timeout: 20 }, (err) => {

expect(err).to.not.exist();
expect(timer.elapsed()).to.be.at.least(9);
expect(timer.elapsed()).to.be.at.most(19);
expect(timer.elapsed()).to.be.between(9, 19);
done();
});

Expand Down Expand Up @@ -1634,8 +1633,8 @@ describe('Connection', () => {
server.on('route', (route, connection, srv) => {

expect(route.path).to.equal('/');
expect(connection.settings.labels).to.deep.equal(['a']);
expect(srv).to.equal(server);
expect(connection.settings.labels).to.equal(['a']);
expect(srv).to.shallow.equal(server);
done();
});

Expand Down Expand Up @@ -1747,7 +1746,7 @@ describe('Connection', () => {

expect(res5.statusCode).to.equal(200);
expect(res5.payload).to.equal('delete');
expect(config.method).to.deep.equal(['GET', 'PUT', 'POST', 'DELETE']);
expect(config.method).to.equal(['GET', 'PUT', 'POST', 'DELETE']);
done();
});
});
Expand Down Expand Up @@ -1804,7 +1803,7 @@ describe('Connection', () => {
});

expect(table).to.have.length(6);
expect(paths).to.only.deep.include([
expect(paths).to.only.include([
{ method: 'get', path: '/api/products' },
{ method: 'get', path: '/api/products/{id}' },
{ method: 'post', path: '/api/products' },
Expand Down
28 changes: 14 additions & 14 deletions test/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ describe('handler', () => {

const server = new Hapi.Server();
server.register(Inert, Hoek.ignore);
server.connection({ routes: { files: { relativeTo: __dirname } } });
server.connection({ routes: { files: { relativeTo: Path.join(__dirname, '../') } } });
const handler = function (request, reply) {

return reply.file('../package.json').code(499);
return reply.file('./package.json').code(499);
};

server.route({ method: 'GET', path: '/file', handler: handler });
Expand Down Expand Up @@ -503,7 +503,7 @@ describe('handler', () => {

server.inject('/user/5', (res) => {

expect(res.result).to.deep.equal({ id: '5', name: 'Bob' });
expect(res.result).to.equal({ id: '5', name: 'Bob' });
done();
});
});
Expand Down Expand Up @@ -536,7 +536,7 @@ describe('handler', () => {

server.inject('/user/5', (res) => {

expect(res.result).to.deep.equal({ id: '5', name: 'Bob' });
expect(res.result).to.equal({ id: '5', name: 'Bob' });
done();
});
});
Expand Down Expand Up @@ -572,7 +572,7 @@ describe('handler', () => {

server.inject('/user/5', (res) => {

expect(res.result).to.deep.equal({ id: '5', name: 'Bob' });
expect(res.result).to.equal({ id: '5', name: 'Bob' });
done();
});
});
Expand Down Expand Up @@ -646,7 +646,7 @@ describe('handler', () => {

server.inject('/user/5', (res) => {

expect(res.result).to.deep.equal({ id: '5', name: 'Bob' });
expect(res.result).to.equal({ id: '5', name: 'Bob' });
done();
});
});
Expand Down Expand Up @@ -679,7 +679,7 @@ describe('handler', () => {

server.inject('/user/5', (res) => {

expect(res.result).to.deep.equal({ id: '5', name: 'Bob' });
expect(res.result).to.equal({ id: '5', name: 'Bob' });
done();
});
});
Expand Down Expand Up @@ -712,7 +712,7 @@ describe('handler', () => {

server.inject('/user', (res) => {

expect(res.result).to.deep.equal({ name: 'Bob' });
expect(res.result).to.equal({ name: 'Bob' });
done();
});
});
Expand Down Expand Up @@ -745,7 +745,7 @@ describe('handler', () => {

server.inject('/user/5', (res) => {

expect(res.result).to.deep.equal({ id: '5', name: 'Bob' });
expect(res.result).to.equal({ id: '5', name: 'Bob' });
done();
});
});
Expand Down Expand Up @@ -778,7 +778,7 @@ describe('handler', () => {

server.inject('/user', (res) => {

expect(res.result).to.deep.equal({ name: 'Bob' });
expect(res.result).to.equal({ name: 'Bob' });
done();
});
});
Expand Down Expand Up @@ -1038,7 +1038,7 @@ describe('handler', () => {

server.inject('/user/5', (res) => {

expect(res.result[0].tags).to.deep.equal(['pre', 'method', 'user']);
expect(res.result[0].tags).to.equal(['pre', 'method', 'user']);
expect(res.result[0].internal).to.equal(true);
expect(res.result[0].data.msec).to.exist();
done();
Expand Down Expand Up @@ -1133,7 +1133,7 @@ describe('handler', () => {
server.route({ method: 'get', path: '/', handler: { test: 'value' } });
server.inject('/', (res) => {

expect(res.result).to.deep.equal({});
expect(res.result).to.equal({});
done();
});
});
Expand All @@ -1160,7 +1160,7 @@ describe('handler', () => {
server.route({ method: 'get', path: '/', handler: { test: 'value' } });
server.inject('/', (res) => {

expect(res.result).to.deep.equal({ x: 1 });
expect(res.result).to.equal({ x: 1 });
done();
});
});
Expand Down Expand Up @@ -1190,7 +1190,7 @@ describe('handler', () => {
server.route({ method: 'get', path: '/', handler: { test: 'value' } });
server.inject('/', (res) => {

expect(res.result).to.deep.equal({ x: 'get' });
expect(res.result).to.equal({ x: 'get' });
done();
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ describe('Methods', () => {

server.inject('/user/5', (res) => {

expect(res.result).to.deep.equal({ id: '5', name: 'Bob' });
expect(res.result).to.equal({ id: '5', name: 'Bob' });
done();
});
});
Expand Down
14 changes: 6 additions & 8 deletions test/payload.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,23 +122,21 @@ describe('payload', () => {
}
};

const req = Http.request(options, (res) => {

});
const req = Http.request(options, (res) => { });

req.write('Hello\n');

req.on('error', (err) => {

expect(message).to.equal('Parse Error');
expect(err.code).to.equal('ECONNRESET');
server.stop(done);
server.stop({ timeout: 10 }, done);
});

setTimeout(() => {

req.abort();
}, 15);
}, 50);
});
});

Expand Down Expand Up @@ -262,7 +260,7 @@ describe('payload', () => {
server.inject(request, (res) => {

expect(res.result).to.exist();
expect(res.result).to.deep.equal(message);
expect(res.result).to.equal(message);
done();
});
});
Expand All @@ -278,7 +276,7 @@ describe('payload', () => {

const receivedContents = Fs.readFileSync(request.payload.path);
Fs.unlinkSync(request.payload.path);
expect(receivedContents).to.deep.equal(sourceContents);
expect(receivedContents).to.equal(sourceContents);
return reply(request.payload.bytes);
};

Expand Down Expand Up @@ -379,7 +377,7 @@ describe('payload', () => {
server.inject({ method: 'POST', url: '/', payload: 'testing123', headers: { 'content-type': 'application/unknown' } }, (res) => {

expect(res.statusCode).to.equal(200);
expect(res.result).to.deep.equal(null);
expect(res.result).to.equal(null);
done();
});
});
Expand Down
Loading

0 comments on commit 86642f2

Please sign in to comment.