You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'd like to be able to know which item in the list is being built if a particular factory is called with createList or buildList.
Describe the solution you'd like
I'd like the value i in this code:
buildList(
number: number,
params?: DeepPartial<T>,
options: BuildOptions<T, I> = {},
): T[] {
let list: T[] = [];
for (let i = 0; i < number; i++) {
list.push(this.build(params, options));
}
return list;
}
Exposed to the factory so I could do something where I build a set of objects with monotonically decreasing dates, for example. My use case is I wanted a set of objects to be built with a date field that was today's date minus i day(s).
Describe alternatives you've considered
I did a workaround where I reset the factory's sequence number in between test runs which works, but it feels like having the option to know the relative sequence number AND the i value from above would be awesome and relatively simple.
Additional context
Let me know if anything is unclear about my request.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I'd like to be able to know which item in the list is being built if a particular factory is called with
createList
orbuildList
.Describe the solution you'd like
I'd like the value
i
in this code:Exposed to the factory so I could do something where I build a set of objects with monotonically decreasing dates, for example. My use case is I wanted a set of objects to be built with a date field that was today's date minus
i
day(s).Describe alternatives you've considered
I did a workaround where I reset the factory's sequence number in between test runs which works, but it feels like having the option to know the relative
sequence
number AND thei
value from above would be awesome and relatively simple.Additional context
Let me know if anything is unclear about my request.
The text was updated successfully, but these errors were encountered: