How to use the animal function from chance

Find comprehensive JavaScript chance.animal code examples handpicked from public code repositorys.

44
45
46
47
48
49
50
51
52
53
function generateMovies(moviesCount, listsCount, reviewsCount) {
  const movies = [];
  for (let i = 0; i < moviesCount; i++) {
    let title =
      "The " +
      chance.animal() +
      " in " +
      chance.city() +
      " " +
      chance.integer({ min: 1, max: 100 });
fork icon0
star icon2
watch icon0

8
9
10
11
12
13
14
15
16
17
      key: i,
      name: chance.name(),
      age: chance.age(),
      adress: chance.address(),
      city: chance.city(),
      pet: chance.animal(),
    };
  }),
};

fork icon0
star icon0
watch icon0

33
34
35
36
37
38
39
40
41
42
.with.NewType('Animal', getType => {
    const birthdate = getType(MockedTypes.Birthday);
    const age = moment().diff(birthdate, 'year');
    const adoptedDate = getType(MockedTypes.Date);
    return {
        type: chance.animal(),
        color: getType('Color'),
        name: getType(MockedTypes.Name.First),
        weight: `${getType(MockedTypes.Number)}lbs`,
        birthdate,
fork icon0
star icon0
watch icon0