mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
@@ -339,23 +339,19 @@ pub const Run = struct {
|
||||
Output.prettyErrorln("Error occurred loading entry point: {s}", .{@errorName(err)});
|
||||
Output.flush();
|
||||
}
|
||||
// TODO: Do a event loop tick when we figure out how to watch the file that wasn't found
|
||||
// under hot reload mode
|
||||
vm.exit_handler.exit_code = 1;
|
||||
vm.onExit();
|
||||
if (run.any_unhandled) {
|
||||
bun.JSC.SavedSourceMap.MissingSourceMapNoteInfo.print();
|
||||
|
||||
if (vm.hot_reload != .none) {
|
||||
vm.eventLoop().tick();
|
||||
vm.eventLoop().tickPossiblyForever();
|
||||
} else {
|
||||
vm.exit_handler.exit_code = 1;
|
||||
vm.onExit();
|
||||
if (run.any_unhandled) {
|
||||
bun.JSC.SavedSourceMap.MissingSourceMapNoteInfo.print();
|
||||
|
||||
Output.prettyErrorln(
|
||||
"<r>\n<d>{s}<r>",
|
||||
.{Global.unhandled_error_bun_version_string},
|
||||
);
|
||||
}
|
||||
vm.globalExit();
|
||||
Output.prettyErrorln(
|
||||
"<r>\n<d>{s}<r>",
|
||||
.{Global.unhandled_error_bun_version_string},
|
||||
);
|
||||
}
|
||||
vm.globalExit();
|
||||
}
|
||||
|
||||
// don't run the GC if we don't actually need to
|
||||
|
||||
@@ -17,6 +17,21 @@ beforeEach(() => {
|
||||
cwd = hotPath;
|
||||
});
|
||||
|
||||
it("preload not found should exit with code 1 and not time out", async () => {
|
||||
const root = hotRunnerRoot;
|
||||
const runner = spawn({
|
||||
cmd: [bunExe(), "--preload=/dev/foobarbarbar", "--hot", root],
|
||||
env: bunEnv,
|
||||
stdout: "inherit",
|
||||
stderr: "pipe",
|
||||
stdin: "ignore",
|
||||
});
|
||||
await runner.exited;
|
||||
expect(runner.signalCode).toBe(null);
|
||||
expect(runner.exitCode).toBe(1);
|
||||
expect(await new Response(runner.stderr).text()).toContain("preload not found");
|
||||
});
|
||||
|
||||
it(
|
||||
"should hot reload when file is overwritten",
|
||||
async () => {
|
||||
|
||||
Reference in New Issue
Block a user