Skip to content

Commit 05f7f57

Browse files
test: wait for a build rather than the handshake's configuration push
Two proxy cases waited for `{ type: "hot" }`, which was this server telling a client what to enable right after the handshake. That configuration is in the client's entry query now, so the first thing the socket says is the build the page is to run. What the cases are about is untouched and still asserted: the HMR upgrade must not reach the proxy target (`backendUpgradeCount` stays `0`), and must not make the proxy log an error. Both hold. `test/server/open-option.js` fails 33/33 here and on `main` alike — it drives a real browser through `open`, which this environment has none of. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UjuMAuk9o6UazjHzcAQCTA
1 parent 266d5ad commit 05f7f57

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

‎test/server/proxy-option.test.js‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ describe("proxy option", () => {
722722
ws.on("message", (raw) => {
723723
const parsed = JSON.parse(raw.toString());
724724
messages.push(parsed);
725-
if (parsed.type === "hot") {
725+
if (parsed.action === "sync" || parsed.action === "built") {
726726
clearTimeout(timer);
727727
resolve();
728728
}
@@ -742,7 +742,9 @@ describe("proxy option", () => {
742742
setTimeout(resolve, 300);
743743
});
744744

745-
expect(messages.some((m) => m.type === "hot")).toBe(true);
745+
expect(
746+
messages.some((m) => m.action === "sync" || m.action === "built"),
747+
).toBe(true);
746748
expect(messages.some((m) => m.type === BACKEND_MESSAGE_TYPE)).toBe(false);
747749
expect(backendUpgradeCount).toBe(0);
748750
});
@@ -812,7 +814,7 @@ describe("proxy option", () => {
812814
ws.on("message", (raw) => {
813815
const parsed = JSON.parse(raw.toString());
814816
messages.push(parsed);
815-
if (parsed.type === "hot") {
817+
if (parsed.action === "sync" || parsed.action === "built") {
816818
clearTimeout(timer);
817819
resolve();
818820
}
@@ -839,7 +841,9 @@ describe("proxy option", () => {
839841
.join("\n");
840842

841843
expect(hpmLines).toBe("");
842-
expect(messages.some((m) => m.type === "hot")).toBe(true);
844+
expect(
845+
messages.some((m) => m.action === "sync" || m.action === "built"),
846+
).toBe(true);
843847
});
844848
});
845849

0 commit comments

Comments
 (0)