mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
PR-URL: https://github.com/nodejs/node/pull/59964 Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
24 lines
637 B
JavaScript
24 lines
637 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const { startNewREPLServer } = require('../common/repl');
|
|
|
|
let evalCalledWithExpectedArgs = false;
|
|
|
|
const { replServer } = startNewREPLServer({
|
|
eval: common.mustCall((cmd, context) => {
|
|
// Assertions here will not cause the test to exit with an error code
|
|
// so set a boolean that is checked later instead.
|
|
evalCalledWithExpectedArgs = (cmd === '\n');
|
|
})
|
|
});
|
|
|
|
try {
|
|
// Empty strings should be sent to the repl's eval function
|
|
replServer.write('\n');
|
|
} finally {
|
|
replServer.write('.exit\n');
|
|
}
|
|
|
|
assert(evalCalledWithExpectedArgs);
|