thoughtbot / fishery

A library for setting up JavaScript objects as test data
MIT License
877 stars 36 forks source link

Fix issue where afterBuild, onCreate modifying factory #47

Closed stevehanson closed 3 years ago

stevehanson commented 3 years ago

Factories are intended to be immutable, but the afterBuild and onCreate builder functions were mutating the factory instead of only adding these functions to the new factory that is returned.

This also fixes the test failure on master after merging #46.