Skip to content

Instantly share code, notes, and snippets.

@mrsimonemms
Created July 20, 2016 20:01
Show Gist options
  • Save mrsimonemms/6452157bef9c94b4182095648e74148e to your computer and use it in GitHub Desktop.
Save mrsimonemms/6452157bef9c94b4182095648e74148e to your computer and use it in GitHub Desktop.
supertest
import restify from "restify";
const app = restify.createServer({
name: 'MyApp',
});
app.listen(8080);
export {app};
import {app} from "path/to/app.js";
import supertest from "supertest-as-promised";
const request = supertest(app;
export {
request
};
import {request} from "path/to/integ.config.js";
describe("test", function () {
beforeEach(function () {
this.request = request.get("/user");
});
it("should call my user endpoint", function () {
return this.request
.expect(401);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment