Questions tagged [faker.js]

faker.js is a JavaScript library for generating fake data. Fake data is useful when building and testing our application. The faker.js can generate fake data for various areas, including address, commerce, company, date, finance, image, random, or name.

faker.js: generate massive amounts of fake data in the browser and node.js.

github repository: link to github repository

36 questions
0
votes
1 answer

Faker avatar is not working in my project

I'm using faker for random information but avtar is unable to open and showing error by clinking this link https://cdn.fakercloud.com/avatars/victor_haydin_128.jpg and i had updated all to latest version. Please help me to solve this issue
0
votes
1 answer

using faker seeds with sequelize.js: a column value based on the value of other column value

function deptTypes(items) { return items[Math.floor(Math.random()*items.length)]; } var items = ["a", "b","c","d","e","f"]; await queryInterface.bulkInsert('reviews', [...Array(50)].map((review) => ( { user_id:…
0
votes
1 answer

Unsafe member access .toString on an `any` value @typescript-eslint/no-unsafe-member-access

I'm getting the following error on line 3 (id: faker.unique(().....): "Unsafe member access .toString on an any value @typescript-eslint/no-unsafe-member-access" I understand why I am getting the error but I am not sure how to fix it. Any…
Marco
  • 624
  • 1
  • 6
  • 21
0
votes
2 answers

What is the right way to import Faker JS?

I see that when importing Faker JS into my NodeJS project and then build it, it bundles the whole module inside it. I just want to bundle a specific module inside it. Is it possible? I, for example, use only the faker.finance.currencyName()…
0
votes
1 answer

How to spy on a fakerjs method call

Faker.js allow you to easily create faked data using for example the following: import * as faker from 'faker' console.log(faker.lorem.text()) So I tried to mock this library to spy the use of faker.lorem.text(): import * as faker from…
johannchopin
  • 13,720
  • 10
  • 55
  • 101
-2
votes
1 answer

How to use Faker library in a Playwright test suite?

I have created a test file with different test blocks for testing a scenario and I want to use the Faker library for generating data. I want to have a base email and password and use them in all test blocks, but for example, when I call the email…
1 2
3