create-app: clean up log output in tests

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-09-11 15:51:31 +02:00
parent 5ecca7e44b
commit 50d6c7e07e
@@ -19,6 +19,7 @@ import mockFs from 'mock-fs';
import child_process from 'child_process';
import path from 'path';
import {
Task,
buildAppTask,
checkAppExistsTask,
checkPathExistsTask,
@@ -27,6 +28,13 @@ import {
templatingTask,
} from './tasks';
jest.spyOn(Task, 'log').mockReturnValue(undefined);
jest.spyOn(Task, 'error').mockReturnValue(undefined);
jest.spyOn(Task, 'section').mockReturnValue(undefined);
jest
.spyOn(Task, 'forItem')
.mockImplementation((_a, _b, taskFunc) => taskFunc());
jest.mock('child_process');
// By mocking this the filesystem mocks won't mess with reading all of the package.jsons