mirror of
https://github.com/moltbot/moltbot.git
synced 2026-03-22 00:51:34 +00:00
test: address review feedback for WSL2 detection tests
- Move afterEach to top-level describe block for proper isolation - Set default return value false for isWSL2Sync mock Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
committed by
Ayaan Zaidi
parent
99e0a86458
commit
02345e4c8c
@@ -3,12 +3,16 @@ import { resolveTelegramAutoSelectFamilyDecision } from "./network-config.js";
|
||||
|
||||
// Mock isWSL2Sync at the top level
|
||||
vi.mock("../infra/wsl.js", () => ({
|
||||
isWSL2Sync: vi.fn(),
|
||||
isWSL2Sync: vi.fn(() => false),
|
||||
}));
|
||||
|
||||
import { isWSL2Sync } from "../infra/wsl.js";
|
||||
|
||||
describe("resolveTelegramAutoSelectFamilyDecision", () => {
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
it("prefers env enable over env disable", () => {
|
||||
const decision = resolveTelegramAutoSelectFamilyDecision({
|
||||
env: {
|
||||
@@ -78,10 +82,6 @@ describe("resolveTelegramAutoSelectFamilyDecision", () => {
|
||||
});
|
||||
|
||||
describe("WSL2 detection", () => {
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
it("disables autoSelectFamily on WSL2", () => {
|
||||
vi.mocked(isWSL2Sync).mockReturnValue(true);
|
||||
const decision = resolveTelegramAutoSelectFamilyDecision({ env: {}, nodeMajor: 22 });
|
||||
|
||||
Reference in New Issue
Block a user