fix(testing): let DOM adapter dictate XHR implementation for tests
The test injector now uses an XHR implementation based on DOM.getXHR, which allows the current DOM adapter to dictate which XHR impl should be used. To prevent the changes to DOM adapter from introducing undesired new dependencies into the benchmarks, separate the async facade into a promise facade which is reexported by facade/async. See #4539
This commit is contained in:
@ -16,6 +16,8 @@ import {
|
||||
|
||||
import {Injectable, NgIf, bind} from 'angular2/core';
|
||||
import {Directive, Component, View, ViewMetadata} from 'angular2/angular2';
|
||||
import {XHR} from 'angular2/src/core/compiler/xhr';
|
||||
import {XHRImpl} from 'angular2/src/core/compiler/xhr_impl';
|
||||
|
||||
// Services, and components for the tests.
|
||||
|
||||
@ -118,6 +120,9 @@ export function main() {
|
||||
}, 0);
|
||||
});
|
||||
|
||||
it('provides a real XHR instance',
|
||||
inject([XHR], (xhr) => { expect(xhr).toBeAnInstanceOf(XHRImpl); }));
|
||||
|
||||
describe('setting up Providers', () => {
|
||||
beforeEachProviders(() => [bind(FancyService).toValue(new FancyService())]);
|
||||
|
||||
|
Reference in New Issue
Block a user