/
githubmirror
/
jest
Обзор
Документация
Войти
/
githubmirror
/
jest
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
e2e/MockStdinWatchPlugin.js
32 строки
772 B
Simen Bekkhus
chore: use for..of instead of forEach (#14517)
19 сен 2023, 13:41
Не верифицирован
19 сен 2023, 13:41
5b56467
Код
Авторство
О чём код?
/** * 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. * */ 'use strict'; class MockStdinWatchPlugin { constructor({stdin, config}) { this._stdin = stdin; if (typeof this._stdin.setRawMode !== 'function') { this._stdin.setRawMode = function () {}; } this._config = config; } apply(jestHooks) { jestHooks.onTestRunComplete(() => { const {keys} = this._config.input.shift(); for (const key of keys) this._stdin.emit('data', key); }); } } /** * Watch plugins are not transpiled hence why we're leaving * this file out of typescript migration */ module.exports = MockStdinWatchPlugin;