- New feature: Added
one(config)
as a helper method to create a single instance. This is equal to calling the created builder directly. PR - New feature: Added
many(N, config)
as a helper method to create an array ofN
instances. PR. - Bug fix: incorrect overrriding of
Date
fields. PR - Bug fix: allow traits to override undefined values. PR
- BREAKING Removed Faker support. If you wish to use it, you may, and you can use the
perBuild
generator to integrate it. PR. - BREAKING Various TypeScript changes to improve type-safety of builders. May cause values that were previously
any
to be typed more strictly, and hence may need code changes PR. - BREAKING Dropped support for Node 10. Minimum Node version is now 12.
- Dropped the dependency on Lodash PR.
Sorry for the lack of updates and silence! I'm hopeful that I can maintain this library more proactively moving forwards and continue to improve test-data-bot.
- Updated Faker to latest version (v5.5.3)
- Support non-truthy values in overrides PR
- Various dependency updates: latest TypeScript, Prettier, ESLint, Jest, and so on.
- Added traits to test-data-bot. See the README for examples.
-
Factories now do not need a factory name property. You can simply pass in the configuration object :
const userBuilder = build({ ... }); // rather than: const userBuilder = build('User', { ... });
You can still pass a name if you like, but it's not required and will probably be removed in a future major version.
- Fix: builders can now take literal
null
orundefined
values: #198 - Fix:
sequence
returnsunknown
notnumber
: #196 - Fix: ship Faker types for nice type hinting: #197
- Upgrade to Prettier 2: #195
- Swap from
yarn
tonpm
: #194
- Completely new version! See README for migration details.
- Add
numberBetween
- PR by @spilist.
- Fix passing primitive values like
null
orundefined
to a builder. (#39)
- Fix a bug where you were unable to pass plain functions in as values to builders
- Fix
arrayOf
behaviour so it can take a builder and correctly call it.
- fix bug that meant overriding a boolean to always be
false
wouldn't happen (#6)
- rebuilt to enable fully nested builders
- add
arrayOf
- add
bool
- Enable
sequence
to take other builders.
- add
oneOf
andincrementingId
- Fix
main
inpackage.json
not pointing in the right place- PR by Kent C. Dodds
- Added
perBuild
generator.
- First release!