本文整理匯總了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();
}));