Guest User

Untitled

a guest
Jan 30th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. "jest": {
  2. "globalSetup": "./setup.js"
  3. }
  4.  
  5. const axios = require('axios');
  6.  
  7. async function getSessionKey() {
  8. const response = await axios.post("http://apiUrl", {
  9. username: "K",
  10. password: "passw0rd"
  11. });
  12. sessionKey = response.data.sessionKey;
  13. global.sessionKey = sessionKey;
  14. }
  15.  
  16. module.exports = getSessionKey;
  17.  
  18. test("create session", () => {
  19. expect(global.sessionKey).toBeTruthy();
  20. });
Add Comment
Please, Sign In to add comment