diff --git a/packages/cli/global-setup.ts b/packages/cli/global-setup.ts index 2913a81..adfdf1f 100644 --- a/packages/cli/global-setup.ts +++ b/packages/cli/global-setup.ts @@ -40,6 +40,7 @@ beforeEach(() => { throw new Error(); }); + vi.spyOn(fs, "writeFileSync").mockImplementation(vi.fn()); vi.spyOn(fs, "readdirSync").mockReturnValue([ "some-domain.com-cert.pem", "some-domain.com-key.pem", diff --git a/packages/cli/src/utils/hosts.test.ts b/packages/cli/src/utils/hosts.test.ts index 02fe18d..030b5eb 100644 --- a/packages/cli/src/utils/hosts.test.ts +++ b/packages/cli/src/utils/hosts.test.ts @@ -57,8 +57,6 @@ ${HOSTS_END} 127.0.0.1 other-domain.com `); - vi.spyOn(fs, "writeFileSync").mockImplementation(vi.fn()); - await setContentToHosts( ` 127.0.0.1 local.domain.io @@ -151,8 +149,6 @@ ${HOSTS_START} ${HOSTS_END} `); - vi.spyOn(fs, "writeFile").mockImplementation(vi.fn()); - await updateHosts("other-domain.com"); // read files diff --git a/packages/cli/src/utils/list-configs.test.ts b/packages/cli/src/utils/list-configs.test.ts index f78f1c9..6fe5ce7 100644 --- a/packages/cli/src/utils/list-configs.test.ts +++ b/packages/cli/src/utils/list-configs.test.ts @@ -30,6 +30,6 @@ describe("Utils - listConfigs", () => { listConfigs(configs); - expect(shell.echo).matchSnapshot(); + expect(shell.echo).toMatchSnapshot(); }); });