Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
var supertest = require('supertest'); //require supertest
const request = supertest(''); //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(){
token = response.body.token //to save the login token for further requests
module.exports =
//, token -- export if token is generated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment