Advertisement
Guest User

Untitled

a guest
Jun 2nd, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. test(`should return 200 for ${numTestUsers} test users`, done => {
  2.         const a = [];
  3.         for (let i = 0; i < numTestUsers; ++i) {
  4.             const password = `password${i}`;
  5.             a.push(() => api.post("/user/register")
  6.                 .send({
  7.                     username: `test${i}`,
  8.                     password: password,
  9.                     confirmPassword: password
  10.                 })
  11.                 .expect(200)
  12.                 .then(res => {
  13.                     credentials.push({ user: res.body.id, password: password });
  14.                 }));
  15.         }
  16.         Promise.all(a).then(done);
  17.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement