/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v26.2.0
test/pummel/test-repl-paste-big-data.js
23 строки
710 B
Matteo Collina
repl: remove dependency on domain module
06 мар 2026, 18:38
Не верифицирован
06 мар 2026, 18:38
a9da9ff
Код
Авторство
О чём код?
'use strict'; const common = require('../common'); const assert = require('assert'); const { startNewREPLServer } = require('../common/repl'); // Pasting big input should not cause the process to have a huge CPU usage. const cpuUsage = process.cpuUsage(); const { replServer } = startNewREPLServer(); replServer.input.emit('data', '{}'); replServer.input.emit('keypress', '', { name: 'left' }); replServer.input.emit('data', 'node'); assert.strictEqual(replServer.line, '{node}'); replServer.input.emit('data', 'a'.repeat(4e4) + '\n'); replServer.input.emit('data', '.exit\n'); replServer.once('exit', common.mustCall(() => { const diff = process.cpuUsage(cpuUsage); assert.ok(diff.user < 4e6); }));