当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript TestBed.resetTestingModule方法代码示例

本文整理汇总了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.');
 });
开发者ID:DanielKucal,项目名称:angular,代码行数:15,代码来源:jit_summaries_integration_spec.ts

示例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();
  });
开发者ID:kevinheader,项目名称:nebular,代码行数:33,代码来源:restore-scroll-top.service.spec.ts

示例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();
    }));
开发者ID:frankenbeanies,项目名称:samuelbostick,代码行数:9,代码来源:navbar.component.spec.ts

示例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
		}
	});
开发者ID:ValueChart,项目名称:WebValueCharts,代码行数:57,代码来源:DiscreteScoreFunction.test.ts

示例6: beforeEach

 beforeEach(() => {
   TestBed.resetTestingModule();
   const bed = TestBed.configureTestingModule({
     providers: [
       NbIconLibraries,
     ],
   });
   iconsLibrary = bed.get(NbIconLibraries);
 });
开发者ID:kevinheader,项目名称:nebular,代码行数:9,代码来源:icons-libraries.spec.ts

示例7: beforeEach

    beforeEach(() => {
      TestBed.resetTestingModule();
      TestBed.configureTestingModule({
        imports: [],
        declarations: [ BannerArtComponent ],
        providers: []
      });

      fixture = TestBed.createComponent(BannerArtComponent);
      component = fixture.componentInstance;
    });
开发者ID:presidential-innovation-fellows,项目名称:code-gov-web,代码行数:11,代码来源:banner-art.component.spec.ts

示例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!');
 });
开发者ID:cironunes,项目名称:angular,代码行数:11,代码来源:module_spec.ts

示例10: beforeEach

    beforeEach(async(() => {
        TestBed.resetTestingModule();

        TestBed.configureTestingModule({
            declarations: [
                AppComponent
            ],
            schemas: [
                NO_ERRORS_SCHEMA
            ]
        }).compileComponents();
    }));
开发者ID:frankenbeanies,项目名称:samuelbostick,代码行数:12,代码来源:app.component.spec.ts


注:本文中的@angular/core/testing.TestBed.resetTestingModule方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。