Files
wehub-resource-sync f9447f8e5f
CI / typecheck · build · test · bundle-size (push) Failing after 1s
CI / clean-room dependency closure smoke (push) Failing after 1s
CI / server-runtime e2e (docker · pg + valkey) (push) Failing after 2s
Deploy Install Scripts / deploy (push) Failing after 2s
Windows / build (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:07:03 +08:00

21 lines
846 B
TypeScript

import { describe, expect, it } from 'bun:test';
import { startCommandWantsDaemon } from '../../src/server/runtime/ServerService.js';
// #2444 — `start` must be FOREGROUND by default (usable under systemd
// Type=simple) and detach only when `--daemon` is explicitly passed.
describe('server CLI start mode (#2444)', () => {
it('runs in the foreground by default (no flags)', () => {
expect(startCommandWantsDaemon([])).toBe(false);
});
it('detaches into a daemon only when --daemon is passed', () => {
expect(startCommandWantsDaemon(['--daemon'])).toBe(true);
expect(startCommandWantsDaemon(['-d'])).toBe(true);
});
it('ignores unrelated flags and stays foreground', () => {
expect(startCommandWantsDaemon(['--verbose'])).toBe(false);
expect(startCommandWantsDaemon(['--port', '9999'])).toBe(false);
});
});