test(packages/tuono): create-json-config test are not clearing writeFileSpy mock (#593)

This commit is contained in:
Marco Pasqualetti
2025-02-23 15:31:56 +01:00
committed by GitHub
parent d679982949
commit 067535c2f6
@@ -1,6 +1,6 @@
import fs from 'fs/promises' import fs from 'fs/promises'
import { describe, expect, it, vitest } from 'vitest' import { beforeEach, describe, expect, it, vitest } from 'vitest'
import react from '@vitejs/plugin-react-swc' import react from '@vitejs/plugin-react-swc'
import { createJsonConfig } from './create-json-config' import { createJsonConfig } from './create-json-config'
@@ -8,6 +8,10 @@ import { createJsonConfig } from './create-json-config'
const writeFileSpy = vitest.spyOn(fs, 'writeFile').mockResolvedValue(void 0) const writeFileSpy = vitest.spyOn(fs, 'writeFile').mockResolvedValue(void 0)
describe('createJsonConfig', () => { describe('createJsonConfig', () => {
beforeEach(() => {
writeFileSpy.mockClear()
})
const sampleConfig = { server: { host: 'h', port: 1 } } const sampleConfig = { server: { host: 'h', port: 1 } }
it('should process config with only server property', async () => { it('should process config with only server property', async () => {