diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/cookiecutter.test.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/cookiecutter.test.ts index 923e22d0a5..7d26bcb20a 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/cookiecutter.test.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/cookiecutter.test.ts @@ -57,8 +57,6 @@ describe('fetch:cookiecutter', () => { createTemporaryDirectory: jest.fn().mockResolvedValue(mockTmpDir), }; - mock({ [`${mockContext.workspacePath}/result`]: {} }); - const mockReader: UrlReader = { read: jest.fn(), readTree: jest.fn(), @@ -75,9 +73,14 @@ describe('fetch:cookiecutter', () => { templaters.register('cookiecutter', cookiecutterTemplater); beforeEach(() => { + mock({ [`${mockContext.workspacePath}/result`]: {} }); jest.restoreAllMocks(); }); + afterEach(() => { + mock.restore(); + }); + it('should call fetchContents with the correct values', async () => { await action.handler(mockContext);