Browse Source

Tiny fix to solve a problem of faker giving a user that's too short.

master
Zed A. Shaw 2 months ago
parent
commit
3bafd5e83e
1 changed files with 13 additions and 7 deletions
  1. +13
    -7
      lib/testing.js

+ 13
- 7
lib/testing.js View File

@@ -97,13 +97,19 @@ const begin = async (start, width=1024, height=2048) => {
return [browser, page];
}

const fake_person = () => ({
name: `${faker.name.firstName()} ${faker.name.lastName()}`,
email: faker.internet.email(),
password: faker.internet.password(),
message: faker.random.words(),
username: faker.internet.userName(),
});
const fake_person = () => {
let username = faker.internet.userName();

if(username.length < 6) username += username;

return {
name: `${faker.name.firstName()} ${faker.name.lastName()}`,
email: faker.internet.email(),
password: faker.internet.password(),
message: faker.random.words(),
username
}
}

const close = () => {
if(browser !== null) browser.close();


Loading…
Cancel
Save