Sam Severance 62becc88f9 fix(docs-infra): fix example compilation issues (#42199)
Fix an issue that prevented the Http (tests) StackBlitz
and Testing (tests) StackBlitz from compiling.

Resolves #42198

PR Close #42199
2021-05-21 18:07:44 +00:00

39 lines
878 B
TypeScript

import 'jasmine-core/lib/jasmine-core/jasmine-html.js';
import 'jasmine-core/lib/jasmine-core/boot.js';
declare var jasmine: any;
import './polyfills';
import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
// Import spec files individually for Stackblitz
import './app/heroes/heroes.service.spec.ts';
import './testing/http-client.spec.ts';
//
bootstrap();
//
function bootstrap() {
if ((window as any).jasmineRef) {
location.reload();
return;
} else {
window.onload?.({} as Event);
(window as any).jasmineRef = jasmine.getEnv();
}
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
}