MCPcopy Create free account
hub / github.com/angular/angular / TestBedImpl

Class TestBedImpl

packages/core/testing/src/test_bed.ts:231–1028  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229 * TestBed is the primary api for writing unit tests for Angular applications and libraries.
230 */
231export class TestBedImpl implements TestBed {
232 private static _INSTANCE: TestBedImpl | null = null;
233
234 static get INSTANCE(): TestBedImpl {
235 return (TestBedImpl._INSTANCE = TestBedImpl._INSTANCE || new TestBedImpl());
236 }
237
238 /**
239 * Teardown options that have been configured at the environment level.
240 * Used as a fallback if no instance-level options have been provided.
241 */
242 private static _environmentTeardownOptions: ModuleTeardownOptions | undefined;
243
244 /**
245 * "Error on unknown elements" option that has been configured at the environment level.
246 * Used as a fallback if no instance-level option has been provided.
247 */
248 private static _environmentErrorOnUnknownElementsOption: boolean | undefined;
249
250 /**
251 * "Error on unknown properties" option that has been configured at the environment level.
252 * Used as a fallback if no instance-level option has been provided.
253 */
254 private static _environmentErrorOnUnknownPropertiesOption: boolean | undefined;
255
256 /**
257 * Teardown options that have been configured at the `TestBed` instance level.
258 * These options take precedence over the environment-level ones.
259 */
260 private _instanceTeardownOptions: ModuleTeardownOptions | undefined;
261
262 /**
263 * Defer block behavior option that specifies whether defer blocks will be triggered manually
264 * or set to play through.
265 */
266 private _instanceDeferBlockBehavior = DEFER_BLOCK_DEFAULT_BEHAVIOR;
267
268 /**
269 * Animations behavior option that specifies whether animations are enabled or disabled.
270 */
271 private _instanceAnimationsEnabled = ANIMATIONS_ENABLED_DEFAULT;
272
273 /**
274 * "Error on unknown elements" option that has been configured at the `TestBed` instance level.
275 * This option takes precedence over the environment-level one.
276 */
277 private _instanceErrorOnUnknownElementsOption: boolean | undefined;
278
279 /**
280 * "Error on unknown properties" option that has been configured at the `TestBed` instance level.
281 * This option takes precedence over the environment-level one.
282 */
283 private _instanceErrorOnUnknownPropertiesOption: boolean | undefined;
284
285 /**
286 * Stores the previous "Error on unknown elements" option value,
287 * allowing to restore it in the reset testing module logic.
288 */

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected