mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 00:20:08 +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
641 B
JavaScript
24 lines
641 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const { startNewREPLServer } = require('../common/repl');
|
|
const assert = require('node:assert');
|
|
|
|
const tmpdir = require('../common/tmpdir');
|
|
tmpdir.refresh();
|
|
|
|
// Tests that an appropriate error is displayed if the user tries to load a non existent file
|
|
|
|
const { replServer, input, output } = startNewREPLServer({ terminal: false });
|
|
|
|
const filePath = tmpdir.resolve('file.does.not.exist');
|
|
|
|
output.write = common.mustCall(function(data) {
|
|
assert.strictEqual(data, `Failed to load: ${filePath}\n`);
|
|
output.write = () => {};
|
|
});
|
|
|
|
input.run([`.load ${filePath}`]);
|
|
|
|
replServer.close();
|