Reset mock after each test
Co-authored-by: Patrik Oldsberg <poldsberg@gmail.com> Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
+5
-2
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user