本文整理汇总了TypeScript中@angular/core/testing.TestBed.resetTestingModule方法的典型用法代码示例。如果您正苦于以下问题:TypeScript TestBed.resetTestingModule方法的具体用法?TypeScript TestBed.resetTestingModule怎么用?TypeScript TestBed.resetTestingModule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular/core/testing.TestBed
的用法示例。
在下文中一共展示了TestBed.resetTestingModule方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should throw when trying to mock a type with a summary', () => {
TestBed.resetTestingModule();
expect(() => TestBed.overrideComponent(SomePrivateComponent, {add: {}}).compileComponents())
.toThrowError(
'SomePrivateComponent was AOT compiled, so its metadata cannot be changed.');
TestBed.resetTestingModule();
expect(() => TestBed.overrideDirective(SomeDirective, {add: {}}).compileComponents())
.toThrowError('SomeDirective was AOT compiled, so its metadata cannot be changed.');
TestBed.resetTestingModule();
expect(() => TestBed.overridePipe(SomePipe, {add: {name: 'test'}}).compileComponents())
.toThrowError('SomePipe was AOT compiled, so its metadata cannot be changed.');
TestBed.resetTestingModule();
expect(() => TestBed.overrideModule(SomeModule, {add: {}}).compileComponents())
.toThrowError('SomeModule was AOT compiled, so its metadata cannot be changed.');
});
示例2: beforeEach
beforeEach(() => {
TestBed.resetTestingModule();
fixture = TestBed.configureTestingModule({
imports: [RouterTestingModule.withRoutes([
{
path: '',
children: [
{
path: '',
component: TestComponent,
},
{
path: 'about',
component: TestComponent,
},
],
},
{
path: '**',
redirectTo: '',
pathMatch: 'full',
},
]),
],
providers: [NbRestoreScrollTopHelper],
declarations: [TestComponent, TestBootstrapComponent],
})
.createComponent(TestBootstrapComponent);
fixture.detectChanges();
});
示例3: beforeEach
beforeEach(() => {
TestBed.resetTestingModule();
TestBed.configureTestingModule({
imports: [
ReactiveFormsModule,
RouterModule.forRoot([]),
HttpModule,
],
declarations: [
PluralizePipe,
SearchResultsComponent,
],
providers: [
ClientService,
StateService,
{ provide: APP_BASE_HREF, useValue: '/' },
{ provide: ActivatedRoute, useClass: MockActivatedRoute },
],
schemas: [
CUSTOM_ELEMENTS_SCHEMA,
],
});
fixture = TestBed.createComponent(SearchResultsComponent);
component = fixture.componentInstance;
});
开发者ID:presidential-innovation-fellows,项目名称:code-gov-web,代码行数:26,代码来源:search-results.component.spec.ts
示例4: beforeEach
beforeEach(async(() => {
TestBed.resetTestingModule();
TestBed.configureTestingModule({
declarations: [
NavbarComponent
]
}).compileComponents();
}));
示例5: before
before(function() {
parser = new XmlValueChartParser();
var valueChartDocument = new DOMParser().parseFromString(HotelChartData, 'application/xml');
hotelChart = parser.parseValueChart(valueChartDocument);
height = 100;
width = 100;
TestBed.resetTestingModule();
TestBed.configureTestingModule({
providers: [
RendererScoreFunctionUtility,
DiscreteScoreFunctionRenderer,
{ provide: ChartUndoRedoService, useValue: chartUndoRedoStub } ],
declarations: [ DiscreteStub ]
});
fixture = TestBed.createComponent(DiscreteStub);
rendererScoreFunctionUtility = TestBed.get(RendererScoreFunctionUtility);
scoreFunctionRenderer = TestBed.get(DiscreteScoreFunctionRenderer);
adjustScoreFunctionInteraction = scoreFunctionRenderer['adjustScoreFunctionInteraction'];
expandScoreFunctionInteraction = scoreFunctionRenderer['expandScoreFunctionInteraction'];
el = d3.select(fixture.debugElement.nativeElement.firstChild);
el.classed('ValueChart svg-content-valuechart', true)
.attr('viewBox', '0 -10' + ' ' + width + ' ' + height)
.attr('preserveAspectRatio', 'xMinYMin meet');
let objective = hotelChart.getAllPrimitiveObjectives()[0];
aaron = hotelChart.getUsers()[0];
aaron.color = "#0000FF";
elements = aaron.getScoreFunctionMap().getObjectiveScoreFunction(objective.getId()).getAllElements();
u = {
el: el,
viewOrientation: ChartOrientation.Vertical,
interactionConfig: { adjustScoreFunctions: false, expandScoreFunctions: false },
height: height,
width: width,
rendererConfig: null,
scoreFunctions: [aaron.getScoreFunctionMap().getObjectiveScoreFunction(objective.getId())],
objective: objective,
colors: [aaron.color],
heightScale: null,
scoreFunctionData: null,
styleUpdate: null,
individual: true
}
});
示例6: beforeEach
beforeEach(() => {
TestBed.resetTestingModule();
const bed = TestBed.configureTestingModule({
providers: [
NbIconLibraries,
],
});
iconsLibrary = bed.get(NbIconLibraries);
});
示例7: beforeEach
beforeEach(() => {
TestBed.resetTestingModule();
TestBed.configureTestingModule({
imports: [],
declarations: [ BannerArtComponent ],
providers: []
});
fixture = TestBed.createComponent(BannerArtComponent);
component = fixture.componentInstance;
});
示例8: beforeEach
beforeEach(() => {
TestBed.resetTestingModule();
TestBed.configureTestingModule({
imports: [],
declarations: [ MobileMenuButtonComponent ],
providers: [ MobileService ]
});
fixture = TestBed.createComponent(MobileMenuButtonComponent);
component = fixture.componentInstance;
});
开发者ID:presidential-innovation-fellows,项目名称:code-gov-web,代码行数:11,代码来源:mobile-menu-button.component.spec.ts
示例9: it
it('allows interceptors to inject HttpClient', (done: DoneFn) => {
TestBed.resetTestingModule();
injector = TestBed.configureTestingModule({
imports: [HttpClientTestingModule],
providers: [
{provide: HTTP_INTERCEPTORS, useClass: ReentrantInterceptor, multi: true},
],
});
injector.get(HttpClient).get('/test').subscribe(() => { done(); });
injector.get(HttpTestingController).expectOne('/test').flush('ok!');
});
示例10: beforeEach
beforeEach(async(() => {
TestBed.resetTestingModule();
TestBed.configureTestingModule({
declarations: [
AppComponent
],
schemas: [
NO_ERRORS_SCHEMA
]
}).compileComponents();
}));