Skip to content

Commit

Permalink
fix:test
Browse files Browse the repository at this point in the history
  • Loading branch information
ngot committed May 5, 2016
1 parent b5c9333 commit 1b5e4a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"koa": "^0.21.0",
"mocha": "~1.19.0",
"mocha-istanbul": "~0.2.0",
"request": "^2.42.0",
"supertest": "^1.2.0",
"xtemplate": "^3.1.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)
});
});
});

0 comments on commit 1b5e4a4

Please sign in to comment.