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: #38161
Backport-PR-URL: #38858
Refs: #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 authored and richardlau committed Jul 20, 2021
1 parent 22afb7c commit 193ea8f
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 193ea8f

Please sign in to comment.