test: speed up targeted unit suites

This commit is contained in:
Peter Steinberger
2026-03-24 19:31:02 +00:00
parent 698c02e775
commit 4029ce738c
11 changed files with 103 additions and 37 deletions

View File

@@ -1,4 +1,4 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import type { WindowsAclEntry, WindowsAclSummary } from "./windows-acl.js";
const MOCK_USERNAME = "MockUser";
@@ -24,7 +24,7 @@ let parseIcaclsOutput: typeof import("./windows-acl.js").parseIcaclsOutput;
let resolveWindowsUserPrincipal: typeof import("./windows-acl.js").resolveWindowsUserPrincipal;
let summarizeWindowsAcl: typeof import("./windows-acl.js").summarizeWindowsAcl;
beforeEach(async () => {
beforeAll(async () => {
vi.resetModules();
({
createIcaclsResetCommand,
@@ -37,6 +37,10 @@ beforeEach(async () => {
} = await import("./windows-acl.js"));
});
beforeEach(() => {
vi.unstubAllEnvs();
});
function aclEntry(params: {
principal: string;
rights?: string[];