mirror of
https://github.com/ading2210/libcurl.js.git
synced 2025-05-13 06:20:02 -04:00
add option to capture stdout
This commit is contained in:
parent
bb9d9239c0
commit
3c517bbaf5
11 changed files with 64 additions and 20 deletions
11
client/tests/scripts/redirect_out.js
Normal file
11
client/tests/scripts/redirect_out.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
async function test() {
|
||||
let output = [];
|
||||
function out_callback(text) {
|
||||
output.push(text);
|
||||
}
|
||||
libcurl.stdout = out_callback;
|
||||
libcurl.stderr = out_callback;
|
||||
await libcurl.fetch("https://example.com/", {_libcurl_verbose: 1});
|
||||
console.log(output);
|
||||
assert(output[0] === "* Host example.com:443 was resolved.", "unexpected output in stderr");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue