MCPcopy Index your code
hub / github.com/nodejs/node / testResetGlobal

Function testResetGlobal

test/parallel/test-repl-reset-event.js:49–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47}
48
49function testResetGlobal() {
50 const { replServer } = startNewREPLServer({ useGlobal: true });
51 replServer.context.foo = 42;
52 replServer.on('reset', common.mustCall(function(context) {
53 assert.strictEqual(
54 context.foo,
55 42,
56 '"foo" property is different from REPL using global as context. ' +
57 `context.foo is ${context.foo}, expected 42.`
58 );
59 }));
60 replServer.resetContext();
61}
62
63testReset(common.mustCall(testResetGlobal));

Callers

nothing calls this directly

Calls 3

startNewREPLServerFunction · 0.85
resetContextMethod · 0.80
onMethod · 0.45

Tested by

no test coverage detected