Skip to content

Commit

Permalink
test: fix test-inspector-cli-address
Browse files Browse the repository at this point in the history
The test was assuming that the entire string being sought would arrive
in a single data chunk, but it can be split across multiple chunks.

PR-URL: nodejs#38161
Backport-PR-URL: nodejs#38858
Refs: nodejs#36481
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
Trott committed May 30, 2021
1 parent 723f00f commit 5a84157
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion deps/node-inspect/test/cli/address.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ function launchTarget(...args) {
};
childProc.on('exit', onExit);
childProc.stderr.setEncoding('utf8');
childProc.stderr.on('data', (data) => {
let data = '';
childProc.stderr.on('data', (chunk) => {
data += chunk;
const ret = kDebuggerMsgReg.exec(data);
childProc.removeListener('exit', onExit);
if (ret) {
Expand Down

0 comments on commit 5a84157

Please sign in to comment.