We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e136c17 commit c7b1270Copy full SHA for c7b1270
test/parallel/test-repl-eval-scope.js
@@ -0,0 +1,23 @@
1
+'use strict';
2
+const common = require('../common');
3
+const assert = require('assert');
4
+const repl = require('repl');
5
+
6
+{
7
+ const stream = new common.ArrayStream();
8
+ const options = {
9
+ eval: common.mustCall((cmd, context) => {
10
+ assert.strictEqual(cmd, '.scope\n');
11
+ assert.deepStrictEqual(context, {animal: 'Sterrance'});
12
+ }),
13
+ input: stream,
14
+ output: stream,
15
+ terminal: true
16
+ };
17
18
+ const r = repl.start(options);
19
+ r.context = {animal: 'Sterrance'};
20
21
+ stream.emit('data', '\t');
22
+ stream.emit('.exit\n');
23
+}
0 commit comments