Skip to content

Commit

Permalink
Merge pull request #5 from koajs/fix-test-iojs
Browse files Browse the repository at this point in the history
fix: test run on iojs and upgrade copy-to
  • Loading branch information
dead-horse committed May 12, 2015
2 parents 1530385 + b44bc7d commit 9314d7d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
language: node_js
node_js:
- 'iojs-2'
- 'iojs-1'
- '0.12'
- '0.11'
script: "make test-travis"
after_script: "npm install coveralls@2 && cat ./coverage/lcov.info | coveralls"
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
"co-sleep": "~0.0.1",
"istanbul-harmony": "*",
"jshint": "*",
"koa": "~0.8.2",
"koa": "~0.20.0",
"mocha": "*",
"pedding": "~1.0.0",
"should": "*",
"supertest": "~0.13.0"
"supertest": "~0.15.0"
},
"dependencies": {
"copy-to": "~1.0.1",
"copy-to": "~2.0.1",
"swig": "~1.4.2"
}
}
9 changes: 7 additions & 2 deletions test/json.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Module dependencies.
*/

var should = require('should');
var fs = require('fs');
var onerror = require('..');
var koa = require('koa');
Expand Down Expand Up @@ -38,8 +39,12 @@ describe('json.test.js', function () {
request(app.callback())
.get('/')
.set('Accept', 'application/json')
.expect(404)
.expect( { error: 'ENOENT, open \'not exist\'' }, done);
.expect(404, function (err, res) {
should.not.exist(err);
res.body.error.should.be.a.String;
res.body.error.should.containEql('ENOENT');
done();
});
});

it('should custom handler', function (done) {
Expand Down
2 changes: 1 addition & 1 deletion test/text.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('text.test.js', function () {
.get('/')
.set('Accept', 'text/plain')
.expect(404)
.expect('ENOENT, open \'not exist\'', done);
.expect(/ENOENT/, done);
});

it('should custom handler', function (done) {
Expand Down

0 comments on commit 9314d7d

Please sign in to comment.