Skip to content

How to create a new Faker module

Steven Atkinson edited this page Oct 13, 2018 · 1 revision

How to create a new Faker module

Follow these steps in order to create a new Faker module:

  1. Create the documentation for the available methods.
  2. Add a link to the documentation to the README.
  3. Create the Faker module with the documented methods.
  4. Add tests for the new Faker module.
  5. Add a new property to the IFakerContainer that returns the new Faker modules interface.
  6. Add a new property to the static Faker class that returns the IFakerContainer property for the created Faker module.

Things to note

  • In the Ruby version it stores data in YAML files. In this version we have Data classes that return an IEnumerable.
  • The IFakerContainer is injected into Faker modules that require access to already implemented modules.
  • The static Faker class is the public API. So it is required that you follow the last two steps from the guide above ☝️
Clone this wiki locally