本文整理汇总了TypeScript中faker.internet类的典型用法代码示例。如果您正苦于以下问题:TypeScript internet类的具体用法?TypeScript internet怎么用?TypeScript internet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了internet类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: generatePigeon
export function generatePigeon(owner: string): Pigeon {
return {
idNumber: faker.internet.ip(),
sex: faker.internet.userName(),
color: faker.internet.userName(),
owner: owner,
father: null,
mother: null
};
}
开发者ID:s-soltys,项目名称:RacingPigeons,代码行数:10,代码来源:load-pigeons.startup.ts
示例2: 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);
});
开发者ID:BCotrim,项目名称:chocobo-api,代码行数:12,代码来源:user.dao.spec.ts
示例3: 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);
});
开发者ID:BCotrim,项目名称:chocobo-api,代码行数:16,代码来源:auth.controller.spec.ts
示例4: 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()
};
})
开发者ID:syafiqrokman,项目名称:angular5-iot-dashboard,代码行数:8,代码来源:mocks.service.ts
示例5: 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');
});
开发者ID:Norestlabs-Mariya,项目名称:backend-ico-dashboard,代码行数:11,代码来源:investor.spec.ts
示例6: 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();
}
}
开发者ID:tyranid-org,项目名称:tyranid,代码行数:16,代码来源:sanitize.ts
示例7: 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(),
};
}
开发者ID:Rigg802,项目名称:SampleApp,代码行数:18,代码来源:faker.ts
示例8:
ipv6Address: () => faker.internet.ipv6(),
开发者ID:codeaudit,项目名称:graphql-faker,代码行数:1,代码来源:fake.ts
示例9: constructor
public constructor() {
this.id = faker.random.number();
this.email = faker.internet.email();
this.password = faker.internet.password();
this.created = faker.date.past();
}
开发者ID:BCotrim,项目名称:chocobo-api,代码行数:6,代码来源:user.builder.ts
注:本文中的faker.internet类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论