feat(core): allow to provide multiple default testing modules (#15054)

This can be used to e.g. add the NoopAnimationsModule by default:

```
TestBed.initTestEnvironment([
  BrowserDynamicTestingModule,
  NoopAnimationsModule
], platformBrowserDynamicTesting());
```
This commit is contained in:
Tobias Bosch
2017-03-10 16:55:32 -08:00
committed by Chuck Jazdzewski
parent 8b5c6b2732
commit 6c8638cf01
3 changed files with 14 additions and 10 deletions

View File

@ -66,11 +66,15 @@ System.config({
// method and kick off Karma (Jasmine).
System.import('@angular/core/testing')
.then(function(coreTesting) {
return System.import('@angular/platform-browser-dynamic/testing')
.then(function(browserTesting) {
return Promise
.all([
System.import('@angular/platform-browser-dynamic/testing'),
System.import('@angular/platform-browser/animations')
])
.then(function(mods) {
coreTesting.TestBed.initTestEnvironment(
browserTesting.BrowserDynamicTestingModule,
browserTesting.platformBrowserDynamicTesting());
[mods[0].BrowserDynamicTestingModule, mods[1].NoopAnimationsModule],
mods[0].platformBrowserDynamicTesting());
});
})
.then(function() {