test: add missing newlines to repl .exit writes · nodejs/node@3d708e0 · GitHub
Skip to content

Commit 3d708e0

Browse files
dario-piotrowiczRafaelGSS
authored andcommitted
test: add missing newlines to repl .exit writes
some tests write `.exit` into a repl server without including a newline character (`\n`), such commands are therefore simply not executed at all, the changes here add the missing newlines and as a side effect remove no longer necessary `end` calls PR-URL: #58041 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
1 parent 25c17ab commit 3d708e0

5 files changed

Lines changed: 7 additions & 10 deletions

test/parallel/test-repl-function-definition-edge-case.js

Lines changed: 3 additions & 2 deletions

test/parallel/test-repl-import-referrer.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,4 @@ child.on('exit', common.mustCall(() => {
2323
}));
2424

2525
child.stdin.write('await import(\'./message.mjs\');\n');
26-
child.stdin.write('.exit');
27-
child.stdin.end();
26+
child.stdin.write('.exit\n');

test/parallel/test-repl-options.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,5 @@ r4.close();
136136
child.stdin.write(
137137
'assert.ok(util.inspect(repl.repl, {depth: -1}).includes("REPLServer"));\n'
138138
);
139-
child.stdin.write('.exit');
140-
child.stdin.end();
139+
child.stdin.write('.exit\n');
141140
}

test/parallel/test-repl-require-context.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,4 @@ child.on('exit', common.mustCall(() => {
2020
child.stdin.write('const isObject = (obj) => obj.constructor === Object;\n');
2121
child.stdin.write('isObject({});\n');
2222
child.stdin.write(`require(${JSON.stringify(fixture)}).isObject({});\n`);
23-
child.stdin.write('.exit');
24-
child.stdin.end();
23+
child.stdin.write('.exit\n');

test/parallel/test-repl-require-self-referential.js

Lines changed: 1 addition & 2 deletions

0 commit comments

Comments
 (0)