Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created June 26, 2020 12:50
Show Gist options
  • Save velotiotech/c313836ffc1c85033d86efce556a9f70 to your computer and use it in GitHub Desktop.
Save velotiotech/c313836ffc1c85033d86efce556a9f70 to your computer and use it in GitHub Desktop.
var supertest = require('supertest'); //require supertest
const request = supertest('https://reqres.in/'); //supertest hits the HTTP server (your app)
/*
This piece of code is for getting the authorization token after login to your app.
const token;
test("Login to the application", function(){
return request.post(``).then((response)=>{
token = response.body.token //to save the login token for further requests
})
});
*/
module.exports =
{
request
//, token -- export if token is generated
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment