X Tutup
Skip to content

Test Injector should not by default mock out Compiler's XHR service #4539

@IgorMinar

Description

@IgorMinar

If I want to test a component with external templates, I need to reach into Angular's privates to override the XHR provider (nee di binding):

import {XHR} from 'angular2/src/core/compiler/xhr';
import {XHRImpl} from 'angular2/src/core/compiler/xhr_impl';

…

beforeEachBindings(() => {
    return bind(XHR).toClass(XHRImpl);
  });

The default is useful only for testing Angular Compiler but not for testing Angular applications, so we should change this so that by default the XHR service is not mocked out and only in the Angular core suite we override the provider with mock.

cc: @wardbell @johnpapa

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: testingIssues related to Angular testing features, such as TestBedtype: bug/fix

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup