You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
532 B

'use strict';
const common = require('../common');
const assert = require('assert');
const repl = require('repl');
{
const stream = new common.ArrayStream();
const options = {
eval: common.mustCall((cmd, context) => {
assert.strictEqual(cmd, '.scope\n');
assert.deepStrictEqual(context, {animal: 'Sterrance'});
}),
input: stream,
output: stream,
terminal: true
};
const r = repl.start(options);
r.context = {animal: 'Sterrance'};
stream.emit('data', '\t');
stream.emit('.exit\n');
}