Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:test #11

Merged
merged 6 commits into from
May 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ notifications:
- yiminghe@gmail.com

node_js:
- 0.11
- 0.12
- 4
- 5
- 6

script:
- npm test
- npm run-script cover
- cat ./coverage/lcov.info | node ./node_modules/coveralls/bin/coveralls
- cat ./coverage/lcov.info | node ./node_modules/coveralls/bin/coveralls
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@
"url": "https://github.com/xtemplate/xtpl/issues"
},
"devDependencies": {
"coveralls": "~2.10.0",
"coveralls": "~2.11.9",
"expect.js": "^0.3.1",
"express": "~3.4.8",
"istanbul": "~0.2.10",
"koa": "^0.21.0",
"mocha": "~1.19.0",
"istanbul": "~0.4.3",
"koa": "^1.2.0",
"mocha": "~2.5.3",
"mocha-istanbul": "~0.2.0",
"request": "^2.42.0",
"xtemplate": "^3.1.0"
"request": "^2.72.0",
"xtemplate": "^4.5.1",
"supertest": "~1.2.0"
}
}
15 changes: 6 additions & 9 deletions tests/specs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ var xtpl = require('../../');
var path = require('path');
var xtplKoa = require('../../lib/koa');
var expect = require('expect.js');
var request = require('supertest');

function normalizeSlash(path) {
if (path.indexOf('\\') !== -1) {
Expand Down Expand Up @@ -73,13 +74,9 @@ describe('xtpl', function () {
});
expect(html).to.be('<&gt;foo20');
});
app.listen(4001);
var request = require('request');
setTimeout(function () {
request({url: 'http://localhost:4001'}, function (error, response, body) {
expect(body).to.be('<&gt;foo20');
done();
});
}, 100);
request(app.listen())
.get('/')
.expect(200)
.expect('<&gt;foo20', done);
});
});
});