Repository navigation
feat(upgrade): provide test helpers for wiring up injectors - #16848
petebacondarwin wants to merge 3 commits into
Conversation
bfe4205 to
c73b392
Compare
|
Looking good! I think we need some more documentation on how to use this. Can this be part of the API docs? |
|
I'll add docs but wanted feedback on whether this is the right API first. |
|
As a reminder, the helpers need to be exported and |
|
Ping? |
|
Sorry I have been distracted. I will tidy it up this week. |
c73b392 to
52735ee
Compare
|
And of course this PR falls foul of the change from CircleCI v1 to v2. |
|
Just checking to see if closing and reopening helps with CircleCI |
gkalpak
left a comment
There was a problem hiding this comment.
Just a few nits. Looks great so far (except that I have no idea about all the places we need to list a new package 😁)
I assume more tests will be added when this is finalized.
One thing I am a little concerned with is the namespacing of the module. Typically @angular/foo/testing is for testing @angular/foo/bar. So, I would expect the testing package for @angular/upgrade/static to be @angular/upgrade/static/testing (while @angular/upgrade/testing sounds more about testing @angular/upgrade).
I hope that eventually, @angular/upgrade will get dropped and @angular/upgrade/static will be moved to @angular/upgrade (together with its testing module).
There was a problem hiding this comment.
Unrelated to this PR: Does this include upgrade/static? Shouldn't it be explicitly imported?
|
Hi @petebacondarwin, I am just wondering what the rough timeline for this to be release will be? |
0743841 to
0260634
Compare
|
@kieranblight - I have been having difficulties getting the new package into the system. I hope to finish this and get it in by the end of this week. |
|
@petebacondarwin thank you, look forward to it :)! |
0ca84ba to
733d0aa
Compare
d3c0ab5 to
590e8c2
Compare
|
You can preview ba85f2e at https://pr16848-ba85f2e.ngbuilds.io/. |
|
You can preview c4c98e4 at https://pr16848-c4c98e4.ngbuilds.io/. |
|
You can preview b9193f6 at https://pr16848-b9193f6.ngbuilds.io/. |
|
You can preview 81184b9 at https://pr16848-81184b9.ngbuilds.io/. |
|
You can preview 5984a60 at https://pr16848-5984a60.ngbuilds.io/. |
|
We should also provide an "injector only version" that does not require a full TestBed to be compiled. E.g. Something like this (thanks to @jbedard) |
|
Would be cool if this got merged in! 😬 |
|
@pburgmer (regarding #16848 (comment)). There is a bug in the |
|
Looks like the failure is legit. I'll have to work on that. |
|
@petebacondarwin any plans to get this in soon? do appreciate the work going on here. |
|
@fzxt - I will need help resolving the Windows CI failures... |
|
Ping? It would be nice to get these helpers in soon. Can any googlers help out with the review? |
|
@jasonaden is working on it :-) |
|
any expectations on when this is going to be finished? thanks! |
|
Apart from the conflicts it is ready to be reviewed. It is unlikely to land before 8.2 or 9 now. |
Adds two new helper functions that can be used when unit testing Angular services that depend upon upgraded AngularJS services, or vice versa. The functions return a module (AngularJS or NgModule) that is configured to wire up the Angular and AngularJS injectors without the need to actually bootstrap a full hybrid application. This makes it simpler and faster to unit test services.
|
Presubmit indicated that we need to perform additional changes in build files in g3 to land this PR. I've added "cleanup" label for now and will look into the build files update asap. Thank you. |
|
Thanks @AndrewKushnir |
|
New VE presubmit, including g3 changes. Note to Caretaker: this PR requires additional change in g3: cl/254085499, to update BUILD file with extra rules to build |
|
For anyone who finds this thread in the future, these helpers are available. Check out the docs here: https://angular.io/api/upgrade/static/testing |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Sits on top of #29466
This PR provides two test helpers for the upgrade/static library, which wire up the Angular and AngularJS injectors without the need for a full bootstrap of a hybrid app.
createAngularJSTestingModule()should be used in AngularJS testscreateAngularTestingModule()should be used in Angular testsCheck out the spec files for example usage.