Closed emab closed 1 year ago
Looks good, but I the history a little and we actually did this implementation at first Then we switched to
hasOwnProperty
to fix a recursive issue #9Not sure if this issue will cause a problem now we have
relationshipsToOmit
handling ... ? What do you think?
Yeah that is a good point actually. This method will call the mock data function and then apply overrides. That mock function would then cause a recursive call as it would also call the previous function again, if we don't provide a way to terminate.
I think this would mean the config option to turn on protection for circular relationships would have to be enabled at all times, otherwise it would cause a breakage. I wonder how often people disable it?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This PR implements a new way of generating mock types. Instead of relying on checking overrides for a specific property name, we instead just spread any provided overrides over the
key:value
object of field to value.In my opinion this has a couple of benefits:
.hasOwnProperty
!
to satisfy TypeScriptI've updated all tests, and looking through the snapshots looks positive!