supertest-helper
v0.0.1
Published
A helper for supertest
Downloads
1
Readme
Supertest Helper
Exmaple
var request = require('supertest');
var supertestHelper = require('supertest-helper');
describe('supertest-helper', function () {
var app;
before(function () {
app = require('path/to/your/app');
});
it('like', function (done) {
request(app)
.get('/api/something')
// match response like {"code": 1}
// e.g. {"code": 1, msg: "success"} would pass test
.expect(supertestHelper.like({
"code": 1
})).end(done);
});
});