mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-02 11:20:22 +00:00
test: preserve node os exports in windows acl mock
This commit is contained in:
@@ -3,10 +3,17 @@ import type { WindowsAclEntry, WindowsAclSummary } from "./windows-acl.js";
|
||||
|
||||
const MOCK_USERNAME = "MockUser";
|
||||
|
||||
vi.mock("node:os", () => ({
|
||||
default: { userInfo: () => ({ username: MOCK_USERNAME }) },
|
||||
userInfo: () => ({ username: MOCK_USERNAME }),
|
||||
}));
|
||||
vi.mock("node:os", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("node:os")>();
|
||||
return {
|
||||
...actual,
|
||||
default: {
|
||||
...actual.default,
|
||||
userInfo: () => ({ username: MOCK_USERNAME }),
|
||||
},
|
||||
userInfo: () => ({ username: MOCK_USERNAME }),
|
||||
};
|
||||
});
|
||||
|
||||
let createIcaclsResetCommand: typeof import("./windows-acl.js").createIcaclsResetCommand;
|
||||
let formatIcaclsResetCommand: typeof import("./windows-acl.js").formatIcaclsResetCommand;
|
||||
|
||||
Reference in New Issue
Block a user