typeorm-seeding icon indicating copy to clipboard operation
typeorm-seeding copied to clipboard

Seeder superclass warning and error

Open lbennett-stacki opened this issue 2 years ago • 2 comments

This will warn users about inoperable seeder classes, throwing on the worst case that all seeders are inoperable.

Migrating from the fork origin, I found that I had implements Seeder instead of extends Seeder, which is compilable but invalid. The CLI said it could find the seeders, and that it had executed them. But I had no results. This was because the seeders sent to useSeeders was an empty array.

It might be worth adding a similar check in useSeeders to keep it reusable but up to you 🤷

lbennett-stacki avatar Apr 04 '23 10:04 lbennett-stacki

Hey @jorgebodega, thanks for providing a migration path to latest typeorm. This is a small DX improvement I found along the way. Let me know if you want to go in a different direction.

lbennett-stacki avatar Apr 04 '23 19:04 lbennett-stacki

Hi! Those changes are okay, but probably some tests are going to fail.

In any case, you have to update the branch and add some test to cover that new case.

jorgebodega avatar Apr 26 '23 20:04 jorgebodega