/
githubmirror
/
jest
Обзор
Документация
Войти
/
githubmirror
/
jest
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/jest-util/src/isInteractive.ts
29 строк
631 B
Simen Bekkhus
fix(jest-util): make sure `isInteractive` works in a browser (#14552)
20 сен 2023, 14:26
Не верифицирован
20 сен 2023, 14:26
f38c05c
Код
Авторство
О чём код?
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import {isCI} from 'ci-info'; function checkIsInteractive(): boolean { if (isCI) { return false; } // this can happen in a browser with polyfills: https://github.com/defunctzombie/node-process/issues/41 if (process.stdout == null) { return false; } if (process.stdout.isTTY) { return process.env.TERM !== 'dumb'; } return false; } const isInteractive = checkIsInteractive(); export default isInteractive;