RobinCK/typeorm-fixtures

[Feature Request] Seeded random

Closed this issue · 1 comments

I'd like my fixtures to be generated randomly, but with a seed.
For faker fields, I use faker.seed(777).
However, this doesn't work with "*" relations.
I tried to use seedrandom package and replace global random, but it doesn't work with global lodash instance which this package uses in ReferenceParser. So I hardcoded seedrandom like this: https://github.com/doomsower/typeorm-fixtures/blob/70cdea8d407fa8d9b9b0f3f29e5a12231ffa875c/src/parsers/ReferenceParser.ts#L14

I think this is a nice feature, but currently there's no mechanism to pass params to parsers, as everything is hardcoded.

Sorry, but I don't understand why this is needed and what is wrong with the current approach