ccswbs / testing

Testcafe-based test suite for hjckrrh.
GNU General Public License v3.0
0 stars 1 forks source link

Add Faker.js (fake data for tests) module (fixes #41) #45

Closed mmafe closed 7 years ago

mmafe commented 7 years ago

Fixes #41

Installs Faker.js module. Provides fake data (e.g. firstname, lastname, email, lorem ipsum, etc.) for tests.

Once installed on an environment, remember to run npm install and npm install --only=dev in the project directory to include the library.

To use in code:

  1. Include const Faker = require('faker'); at the top of your test file
  2. In your test, you can generate random data using format Faker.<lib name>.<method()>; so for example:
var firstName = Faker.name.firstName();
var lastName = Faker.name.lastName();
var summary = Faker.lorem.paragraph();
var teaser = Faker.lorem.sentence();
mmafe commented 7 years ago

Merged onto next branch for demo. After demo, will create pull request to the master branch for testing.