本文整理汇总了TypeScript中faker.internet.email方法的典型用法代码示例。如果您正苦于以下问题:TypeScript internet.email方法的具体用法?TypeScript internet.email怎么用?TypeScript internet.email使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类faker.internet
的用法示例。
在下文中一共展示了internet.email方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: times
data: times(3, (index) => {
return {
'id' : index + +offset + 1,
'firstname': faker.name.findName().split(' ')[0],
'lastname': faker.name.findName().split(' ')[0],
'email': faker.internet.email()
};
})
示例2: it
it('should not allow to invite more than 5 emails at once', () => {
const emails = [];
for (let i = 0; i < 6; i++) {
emails.push(faker.internet.email());
}
expect(
() => this.investor.checkAndUpdateInvitees(emails)
).to.throw('It is not possible to invite more than 5 emails at once');
});
示例3: beforeEach
beforeEach(() => {
mockDBClient = {
insert: sinonSandbox.stub(),
returning: sinonSandbox.stub(),
};
fakeEmail = faker.internet.email();
fakePassword = faker.internet.password();
dbClientStub = sinonSandbox.stub(DBClient, 'knex').returns(mockDBClient);
mockDBClient.insert.returns(mockDBClient);
});
示例4: beforeEach
beforeEach(() => {
request = {
body: {
email: faker.internet.email(),
password: faker.internet.password(),
},
};
response = {
sendStatus: sinonSandbox.stub(),
};
next = sinonSandbox.stub();
daoStub = sinonSandbox.stub(UserDao, 'create');
encryptedPassword = faker.internet.password();
sinonSandbox.stub(bcrypt, 'hashSync').returns(encryptedPassword);
});
示例5: switch
function getSanitizedValue<D>(
defaultValue: D,
sanitizeConfig?: SanitizeConfig
) {
if (!sanitizeConfig) return defaultValue;
switch (sanitizeConfig) {
case 'name':
return faker.name.findName();
case 'email':
return faker.internet.email();
case 'lorem':
return faker.lorem.sentences();
default:
return faker.lorem.text();
}
}
示例6: createFakeRowObjectData
createFakeRowObjectData(index: number): Object {
return {
id: index,
avartar: faker.image.avatar(),
city: faker.address.city(),
email: faker.internet.email(),
firstName: faker.name.firstName(),
lastName: faker.name.lastName(),
street: faker.address.streetName(),
zipCode: faker.address.zipCode(),
date: faker.date.past(),
bs: faker.company.bs(),
catchPhrase: faker.company.catchPhrase(),
companyName: faker.company.companyName(),
words: faker.lorem.words(),
sentence: faker.lorem.sentence(),
};
}
示例7: constructor
public constructor() {
this.id = faker.random.number();
this.email = faker.internet.email();
this.password = faker.internet.password();
this.created = faker.date.past();
}
示例8:
func: (provider) => faker.internet.email(undefined, undefined, provider),