Created
July 20, 2016 20:01
-
-
Save mrsimonemms/6452157bef9c94b4182095648e74148e to your computer and use it in GitHub Desktop.
supertest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import restify from "restify"; | |
const app = restify.createServer({ | |
name: 'MyApp', | |
}); | |
app.listen(8080); | |
export {app}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {app} from "path/to/app.js"; | |
import supertest from "supertest-as-promised"; | |
const request = supertest(app; | |
export { | |
request | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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