diff --git a/packages/cli/package.json b/packages/cli/package.json index 5082c8a..c9672a4 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -41,7 +41,7 @@ "build-run": "ncc build -m src/run.ts -o dist/run", "build": "ncc build -m src/index.ts -o dist && npm run build-run", "to-publish": "npx vite-node publish.js", - "test": "vitest --reporter=verbose", + "test": "vitest --reporter=verbose --pool=forks", "lint": "eslint ./src" }, "dependencies": { diff --git a/packages/cli/src/utils/generate-proxy-image.test.ts b/packages/cli/src/utils/generate-proxy-image.test.ts index 668b652..39675d7 100644 --- a/packages/cli/src/utils/generate-proxy-image.test.ts +++ b/packages/cli/src/utils/generate-proxy-image.test.ts @@ -55,6 +55,7 @@ describe("Utils - generateProxyImage", () => { ]); expect(fs.existsSync).toBeCalledTimes(4); + expect(mkcert).toBeCalledTimes(2); expect(mkcert).nthCalledWith( 1, @@ -67,6 +68,10 @@ describe("Utils - generateProxyImage", () => { "/root/path/.local-ssl-management/ssl", ); + // read files + expect(fs.readFileSync).not.toBeCalled(); + + // write files expect(fs.writeFileSync).toBeCalledTimes(2); expect(fs.writeFileSync).toMatchSnapshot(); diff --git a/packages/cli/vitest.config.mts b/packages/cli/vitest.config.mts index e3982d6..bbc106c 100644 --- a/packages/cli/vitest.config.mts +++ b/packages/cli/vitest.config.mts @@ -10,6 +10,10 @@ export default mergeConfig( globals: true, environment: "node", setupFiles: "./global-setup.ts", + clearMocks: true, + snapshotFormat: { + printBasicPrototype: false, + }, }, resolve: { alias: {