How to use the faker.address function in faker

To help you get started, we’ve selected a few faker examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github leapfrogtechnology / just-handlebars-helpers / tests / helpers / formatters.spec.js View on Github external
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('');
    });
github realm / realm-graphql / tests / generate-fake-data.ts View on Github external
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);
        }
    });
github webkom-co / airframe-next / app / routes / components / Gallery / GalleryCard.js View on Github external
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() }
github RandomAPI / Randomuser.me-Node / api / 1.2 / api.js View on Github external
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')
github webkom-co / airframe-next / app / routes / components / Chat / ChatLeftNav.js View on Github external
key="avatar-icon-bg"
                                        /&gt;,
                                        
                                    ]}
                                /&gt; 
                            
                            
                                <div>
                                    { faker.name.firstName() } { faker.name.lastName() }
                                </div>
                                <span>
                                    { faker.address.country() }
                                </span>
                            
                        
                    
github dexteryy / Project-WebCube / examples / webcube-examples / src / redux-source-sample / common / apis / shops / resolvers / mock.js View on Github external
export const positionGetter = () => ({
  latitude: faker.address.latitude(),
  longitude: faker.address.longitude(),
});
github Canner / canner / packages / canner-helpers / src / createFakeData.js View on Github external
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()
        };
github MennaDarwish / DSP / db / seeds.js View on Github external
}).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 &lt; 10; i++) {