diff --git a/packages/jest-snapshot/src/__tests__/InlineSnapshots.test.ts b/packages/jest-snapshot/src/__tests__/InlineSnapshots.test.ts index 304b098301c4..a1c275177865 100644 --- a/packages/jest-snapshot/src/__tests__/InlineSnapshots.test.ts +++ b/packages/jest-snapshot/src/__tests__/InlineSnapshots.test.ts @@ -30,16 +30,20 @@ jest.mock('prettier', () => { return mockPrettier; }); -let dir: string; beforeEach(() => { jest.mocked(prettier.resolveConfig.sync).mockReset(); }); +let dir: string; beforeEach(() => { dir = path.join(tmpdir(), `jest-inline-snapshot-test-${Date.now()}`); fs.mkdirSync(dir); }); +afterEach(() => { + fs.rmSync(dir, {recursive: true}); +}); + test('saveInlineSnapshots() replaces empty function call with a template literal', () => { const filename = path.join(dir, 'my.test.js'); fs.writeFileSync(filename, 'expect(1).toMatchInlineSnapshot();\n');