當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。