typeorm
typeorm copied to clipboard
Print out a warning if no entities are passed
Description of change
This is a very common problem for people getting started with Typeorm: They have it configured wrong and no entities are actually being passed into the system. The migration runner will then print out that nothing is to be done and you as a beginner don't really have an easy way to figure out what is going wrong here.
This is a simply check and warning in the migration create CLI to catch this case and print out a message that could help the person debug this situation.
Pull-Request Checklist
- [x] Code is up-to-date with the
masterbranch - [x]
npm run formatto apply prettier formatting - [x]
npm run testpasses with this change - [x] This pull request links relevant issues as: #2961 and #10558
- [ ] ~~There are new or updated unit tests validating the change~~
- [ ] ~~Documentation has been updated to reflect this change~~
- [x] The new commits follow conventions explained in CONTRIBUTING.md
@alper Ha, great. This is actually something I wanted to work on today, but I see you already tackled it. Great addition.
@pleerock when you have time; this could've saved me a lot of time
HI @alper thanks for your help Can you add a test for this scenario please?
Sure thing!
I'm following the guide in DEVELOPER.md but the tests don't run cleanly as it is.
I don't see how I can add tests given the fact that they look to be broken.
I don't see how I can add tests given the fact that they look to be broken
We should probably add a spy or a stub for console.log but that may require more actions (I'm not sure if console.loging was tested before in this project)
In case if you can't run the tests on your machine (currently there's a bug in the tests that prevent it from succession on Windows) you can push changes in this PR and we run tests on GitHub Actions (after we make sure that the tests are fine).
OK. Added some tests.
Tests run on my fork. So please check this.