Skip to content

Commit 9805a84

Browse files
committed
Add logs for CI debugging
1 parent c4942d5 commit 9805a84

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

end2end/tests/hono-sqlite3-esm.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,24 @@ t.test("it logs esm warnings", (t) => {
1414
});
1515

1616
server.on("close", () => {
17+
console.log("Server closed, t.end()");
1718
t.end();
1819
});
1920

2021
server.on("error", (err) => {
22+
console.log("Server error", err);
2123
t.fail(err.message);
2224
});
2325

2426
let stdout = "";
2527
server.stdout.on("data", (data) => {
28+
console.log(data.toString());
2629
stdout += data.toString();
2730
});
2831

2932
let stderr = "";
3033
server.stderr.on("data", (data) => {
34+
console.log(data.toString());
3135
stderr += data.toString();
3236
});
3337

@@ -56,17 +60,22 @@ t.test("it logs esm warnings", (t) => {
5660
.then(([sqlInjection, normalAdd]) => {
5761
t.equal(sqlInjection.status, 200); // Not blocked
5862
t.equal(normalAdd.status, 200);
63+
console.log("Matching stdout and stderr");
5964
t.match(
6065
stderr,
6166
/Your application seems to be running in ESM mode\. Zen does not support ESM at runtime yet\./
6267
);
68+
console.log("Matching starting agent");
6369
t.match(stdout, /Starting agent/);
70+
console.log("Matching SQL injection");
6471
t.notMatch(stderr, /Zen has blocked an SQL injection/); // Not supported
72+
console.log("Finished matching");
6573
})
6674
.catch((error) => {
6775
t.fail(error.message);
6876
})
6977
.finally(() => {
78+
console.log("Killing server");
7079
server.kill();
7180
});
7281
});

0 commit comments

Comments
 (0)