Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should return empty value for invalid currency code only', () => {
const template = compile('{{formatCurrency 1234567.89 code=countryCode}}');
expect(template({ countryCode: faker.address.countryCode() })).toEqual('');
});
realm.write(() => {
for (let index = 0; index < 300; index++) {
const u = realm.create(UserSchema.name, {
userId: faker.random.uuid(),
firstName: faker.name.firstName(),
lastName: faker.name.lastName(),
address: faker.address.streetAddress()
}, true);
users.push(u);
}
});
key="avatar-icon-bg"
/>,
]}
/>
<div>
{ faker.name.firstName() } { faker.name.lastName() }
</div>
<span>
{ faker.address.state() }, { faker.address.stateAbbr() }
</span>
{ faker.commerce.department() }
{ faker.commerce.department() }
{ faker.commerce.department() }
let name = this.randomName(this.current.gender, nat);
this.include('name', {
title: this.current.gender === 'male' ? 'mr' : randomItem(this.datasets.common.title),
first: name[0],
last: name[1]
});
let timezone = JSON.parse(randomItem(this.datasets.common.timezones));
this.include('location', {
street: range(1, 9999) + ' ' + randomItem(this.datasets[nat].street),
city: randomItem(this.datasets[nat].cities),
state: randomItem(this.datasets[nat].states),
postcode: range(10000, 99999),
coordinates: {
latitude: faker.address.latitude(),
longitude: faker.address.longitude()
},
timezone
});
this.include('email', name[0] + '.' + name[1].replace(/ /g, '') + '@example.com');
let salt = random(2, 8);
let password = this.password === undefined ? randomItem(this.datasets.common.passwords) : this.genPassword();
this.include('login', {
uuid: faker.random.uuid(),
username: randomItem(this.datasets.common.user1) + randomItem(this.datasets.common.user2) + range(100, 999),
password,
salt: salt,
md5: crypto.createHash('md5').update(password + salt).digest('hex'),
sha1: crypto.createHash('sha1').update(password + salt).digest('hex'),
sha256: crypto.createHash('sha256').update(password + salt).digest('hex')
key="avatar-icon-bg"
/>,
]}
/>
<div>
{ faker.name.firstName() } { faker.name.lastName() }
</div>
<span>
{ faker.address.country() }
</span>
export const positionGetter = () => ({
latitude: faker.address.latitude(),
longitude: faker.address.longitude(),
});
break;
}
result = mapSchema(schema.items, loop);
result.__typename = result.__typename || null;
break;
}
case 'array':
result = getArrayData(schema, key, listLength, loop);
break;
case 'number':
result = faker.random.number();
break;
case 'geoPoint':
result = {
__typename: null,
lat: faker.address.latitude(),
lng: faker.address.longitude(),
address: faker.address.city(),
placeId: faker.random.uuid()
};
break;
case 'dateTime':
result = faker.date.past().toISOString();
break;
case 'file':
result = {
__typename: null,
contentType: faker.system.mimeType(),
size: faker.random.number(),
name: faker.system.commonFileName(),
url: faker.internet.url()
};
}).then(function(campaign) {
var geoProperties = {}
if(campaign.dataValues.id % 3 == 0) geoProperties = {city: faker.address.city(), country: faker.address.country()}
if(campaign.dataValues.id % 3 == 1) geoProperties = {longitude: faker.address.longitude(), latitude: faker.address.latitude(), radius: 25}
geoProperties['campaignId'] = campaign.dataValues.id;
return GeoTarget.create(geoProperties)
}).then(function(geo) {
for (i = 0; i < 10; i++) {