MCPcopy Create free account
hub / github.com/angular/components / _isTestEnvironment

Function _isTestEnvironment

src/cdk/platform/features/test-environment.ts:10–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8
9/** Gets whether the code is currently running in a test environment. */
10export function _isTestEnvironment(): boolean {
11 // We can't use `declare const` because it causes conflicts inside Google with the real typings
12 // for these symbols and we can't read them off the global object, because they don't appear to
13 // be attached there for some runners like Jest.
14 // (see: https://github.com/angular/components/issues/23365#issuecomment-938146643)
15 return (
16 // @ts-ignore
17 (typeof __karma__ !== 'undefined' && !!__karma__) ||
18 // @ts-ignore
19 (typeof jasmine !== 'undefined' && !!jasmine) ||
20 // @ts-ignore
21 (typeof jest !== 'undefined' && !!jest) ||
22 // @ts-ignore
23 (typeof Mocha !== 'undefined' && !!Mocha)
24 );
25}

Callers 1

_createContainerMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected