Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

main-navigation test finds the function's end on a Windows checkout too

milind-sonibc2ca1f1a806
diff --git a/electron/main-navigation.node-test.mjs b/electron/main-navigation.node-test.mjs
index 30ac34c5a2..2bddd1998b 100644
--- a/electron/main-navigation.node-test.mjs
+++ b/electron/main-navigation.node-test.mjs
@@ -7,7 +7,8 @@ test("a navigation retires the launch recovery, except the recovery's own", asyn
const source = readFileSync(new URL("./main.mjs", import.meta.url), "utf8");
const start = source.indexOf("function navigateMainWindow(");
assert.ok(start > 0);
- const end = source.indexOf("\n}\n", start) + 3;
+ const close = /\r?\n\}\r?\n/.exec(source.slice(start)); // a Windows checkout ends lines with \r\n
+ const end = start + close.index + close[0].length;
const calls = [];
const context = vm.createContext({
homeWindow: { cancel: () => calls.push("cancel") },