test-environment-CT0XxPyp.mjs 854 B

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