/**
 * Create fake user for testing
 */

import faker from 'faker';

class UserFactory {
  generateList(count, attrs = {}) {
    const list = [];
    let numberOfUsersToCreate = count;

    while (numberOfUsersToCreate) {
      list.push(this.generate(attrs));
      numberOfUsersToCreate--;
    }

    return list;
  }

  generate(attrs) {
    return {
      name: `${faker.name.firstName()} ${faker.name.lastName()}`,
      username: faker.internet.userName(),
      email: faker.internet.email(),
      password: 'password1',
      ...attrs,
    };
  }
}

export default new UserFactory();

@@ -82,16 +82,204 @@
 ctory %7B%0A
+  /**%0A   * Generate an list of fake user%0A   *%0A   * @public%0A   * @param %7BNumber%7D number of user want for test%0A   * @param %7BObject%7D other attributes%0A   * @returns %7BArray%7D of fake user%0A   */%0A
   genera
@@ -502,16 +502,135 @@
 t;%0A  %7D%0A%0A
+  /**%0A   * Create a user%0A   *%0A   * @public%0A   * @param %7BObject%7D attrs of user%0A   * @returns %7BObject%7D a fake user%0A   */%0A
   genera

Add comments on factory