Skip to content

Commit

Permalink
test(cli): update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaslz committed Jan 28, 2024
1 parent 8813298 commit 78850df
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/cli/global-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 0 additions & 4 deletions packages/cli/src/utils/hosts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -151,8 +149,6 @@ ${HOSTS_START}
${HOSTS_END}
`);

vi.spyOn(fs, "writeFile").mockImplementation(vi.fn());

await updateHosts("other-domain.com");

// read files
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/utils/list-configs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ describe("Utils - listConfigs", () => {

listConfigs(configs);

expect(shell.echo).matchSnapshot();
expect(shell.echo).toMatchSnapshot();
});
});

0 comments on commit 78850df

Please sign in to comment.