Skip to content

Commit

Permalink
fix(host): componentProviders should act on the component
Browse files Browse the repository at this point in the history
  • Loading branch information
NetanelBasal committed Oct 11, 2018
1 parent b90881d commit ef84b16
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/lib/src/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ export function createHostComponentFactory<C, H = HostComponent>(options: Specta

beforeEach(() => {
jasmine.addMatchers(customMatchers as any);
});

beforeEach(() => {
TestBed.configureTestingModule(moduleMetadata);
});

Expand All @@ -83,7 +80,13 @@ export function createHostComponentFactory<C, H = HostComponent>(options: Specta
}
});

TestBed.overrideComponent(host, { set: { template: template, providers: [moduleMetadata.componentProviders] } });
TestBed.overrideComponent(host, { set: { template: template } });

TestBed.overrideComponent(component, {
set: {
providers: [moduleMetadata.componentProviders]
}
});

const spectatorWithHost = new SpectatorWithHost<C, H>();
spectatorWithHost.hostFixture = TestBed.createComponent(host);
Expand Down

0 comments on commit ef84b16

Please sign in to comment.