Created
February 28, 2021 14:45
-
-
Save shridharkalagi/4726ef860f000d5af18948d275c80685 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 fetch from 'node-fetch' | |
usersList = ['user1', 'user2', ...'usern'] | |
let userRequests = [] | |
let userIndex = 0 | |
for (let i = 0; i < 2; i++) { | |
for (let j = 0; j < 20; j++) { | |
userRequests.push(getEachUser(usersList[userIndex])) | |
userIndex++ | |
} | |
await Promise.all(userRequests).then((responseData) => { | |
responseData.forEach((element) => { | |
const statusCode = element[0] | |
const user = element[1] | |
assert.equal(statusCode, 200, 'API call failed for user ' + user) | |
}) | |
}) | |
userRequests.splice(0, userRequests.length) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment