From 50d6c7e07e23a8b24be93587a122e69a91aaeaed Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sun, 11 Sep 2022 15:51:31 +0200 Subject: [PATCH] create-app: clean up log output in tests Signed-off-by: Patrik Oldsberg --- packages/create-app/src/lib/tasks.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/create-app/src/lib/tasks.test.ts b/packages/create-app/src/lib/tasks.test.ts index 6a312436bf..d2efe81b90 100644 --- a/packages/create-app/src/lib/tasks.test.ts +++ b/packages/create-app/src/lib/tasks.test.ts @@ -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