fix(test): use mockReturnValueOnce for pwsh shell mock to prevent test pollution
vi.clearAllMocks() clears call history but not mockReturnValue implementations. The Windows pwsh shell tests were polluting subsequent tests that expected the default sh mock. Changed to mockReturnValueOnce so the override is consumed by the single call and subsequent tests get the default sh implementation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
17946940f4
commit
ed9fca84d2
|
|
@ -644,7 +644,7 @@ describe("workspace.postCreate()", () => {
|
|||
|
||||
const project = makeProject({ postCreate: ["npm install"] });
|
||||
|
||||
mockGetShell.mockReturnValue({
|
||||
mockGetShell.mockReturnValueOnce({
|
||||
cmd: "pwsh",
|
||||
args: (c: string) => ["-NoLogo", "-NonInteractive", "-Command", c],
|
||||
});
|
||||
|
|
|
|||
|
|
@ -885,7 +885,7 @@ describe("workspace.postCreate()", () => {
|
|||
const ws = create();
|
||||
const project = makeProject({ postCreate: ["npm install"] });
|
||||
|
||||
mockGetShell.mockReturnValue({
|
||||
mockGetShell.mockReturnValueOnce({
|
||||
cmd: "pwsh",
|
||||
args: (c: string) => ["-NoLogo", "-NonInteractive", "-Command", c],
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue