-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: refactor ng-add
to make it easier to add moar tests
#974
test: refactor ng-add
to make it easier to add moar tests
#974
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @davidlj95 and the rest of your teammates on |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #974 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 86 86
Lines 365 365
Branches 52 52
=========================================
Hits 365 365 ☔ View full report in Codecov by Sentry. |
📦 Bundle size (Angular v15)Git ref:
|
📦 Bundle size (Angular v16)Git ref:
|
📦 Bundle size (Angular v17)Git ref:
|
📦 Bundle size (Angular v18)Git ref:
|
22dd9c2
to
bdcf51d
Compare
🎉 This PR is included in version 1.0.0-beta.27 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Issue or need
After starting to add more features to the
ng-add
schematic, noticed that same test code repeats over and over.Despite being conscious that WET > DRY in tests, the
T
wice ofWET
was definitely not twice.Some things can be abstracted to avoid repeating the same tests around and around.
Proposed changes
Add an abstraction to allow testing whether providers are added or not to the root file (app config / app module):
shouldAddRootProvider
.Also extracts util functions into
testing
directoriesQuick reminders