Closed theo-bittencourt closed 3 years ago
You can use this code: https://github.com/RobinCK/typeorm-fixtures#programmatically-loading-fixtures after each test clear database and repeat load dataset
Yep! I'm using that already.
But I'm not sure whether that will continue to work fine for complex relationships. It's been harder to set up the e2e tests as the project grows up because we need to look up for multiple files to track the correct relationships.
Coming from Rails, I'm missing something like FactoryBot to build these data for tests.
I can't figure out yet how Node devs are setting up that data.
Hey I'm missing the same. The way Rails is handling data during tests with FactoryBot is so useful.
Is it possible not to load all the fixtures but only specific ones (and then all recursive references) ?
Hey. Thank you for this great project!
My main intention with this lib is to load fixtures for automated testing on a Nest project. But after reading the following statement in the README, it has brought me doubts about the purpose of this library:
Loading the fixtures using the CLI means the data will be loaded once for the entire testing suite. One general practice for automated testing is to isolate testing data between testing cases. I'm trying to figure out why programmatically loading is not faced as the first option here. π