Closed atomanyih closed 2 years ago
Thanks for opening this issue. This was fixed by #94 and released in v2.2.1. I will go ahead and close this, but if you are still seeing the issue, feel free to reopen.
I'm realizing, though, that this is an issue not just for Date but for any custom object with a constructor or prototype (eg. I still get the issue with DayJs). I'll open a separate issue for this.
Description
If you have a factory for a type with a
Date
attribute, the param is typed asDeepPartial<Date>
which you can't use to override default values.It seems like
Date
should possibly be one of the exceptions defined indeepPartial.ts
because it doesn't make sense to have it as a partial (similar toSet
,Map
, etc)To Reproduce
sandbox: https://codesandbox.io/s/fishery-test-forked-g8rbsi
Additional context You can work around this by accessing
createdAt
or otherDate
attributes throughassociations
, but this feels hacky