Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/host-kit/src/internal/exec-trace.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { ChildProcess, spawn } from 'node:child_process';
import fs from 'node:fs';
// oxlint-disable-next-line no-restricted-imports -- vi.spyOn(os,'homedir'): os.homedir() ignores a stubbed HOME in worker threads
import os from 'node:os';
import path from 'node:path';
import { PassThrough } from 'node:stream';
import { afterEach, expect, test, vi } from 'vitest';
Expand Down Expand Up @@ -199,7 +201,7 @@ for (const fixedLogPath of [true, false]) {
vi.useFakeTimers();
const fixture = processFixture();
const home = mkdtempForTestSync('exec-late-close-');
vi.stubEnv('HOME', home);
const homedir = vi.spyOn(os, 'homedir').mockReturnValue(home);
const logPath = fixedLogPath ? path.join(home, 'request.ndjson') : undefined;
try {
await withCommandHost(
Expand Down Expand Up @@ -242,7 +244,7 @@ for (const fixedLogPath of [true, false]) {
}),
);
} finally {
vi.unstubAllEnvs();
homedir.mockRestore();
}
});
}
Expand Down
Loading