feat(upgrade): provide unit test helpers for wiring up injectors (#16848)

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.

PR Close #16848
This commit is contained in:
Pete Bacon Darwin
2019-03-22 09:42:52 +00:00
committed by Kara Erickson
parent 5e53956c2b
commit 3fb78aaacc
20 changed files with 506 additions and 9 deletions

View File

@ -39,6 +39,7 @@ import * as routerUpgrade from '@angular/router/upgrade';
import * as serviceWorker from '@angular/service-worker';
import * as upgrade from '@angular/upgrade';
import * as upgradeStatic from '@angular/upgrade/static';
import * as upgradeTesting from '@angular/upgrade/static/testing';
export default {
animations,
@ -71,5 +72,6 @@ export default {
routerUpgrade,
serviceWorker,
upgrade,
upgradeStatic
upgradeStatic,
upgradeTesting,
};