diff --git a/package.json b/package.json index 0e9101b63..094ae02ba 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "packageManager": "pnpm@9.10.0", "scripts": { "start": "pnpm --filter grapesjs start", - "test": "pnpm --filter grapesjs test", + "test": "pnpm -r run test", "docs": "pnpm --filter @grapesjs/docs docs", "docs:api": "pnpm --filter @grapesjs/docs docs:api", "lint": "eslint .", diff --git a/packages/cli/test/utils.spec.ts b/packages/cli/test/utils.spec.ts index d01d2f75c..7caee590e 100644 --- a/packages/cli/test/utils.spec.ts +++ b/packages/cli/test/utils.spec.ts @@ -85,12 +85,12 @@ describe('utils', () => { const color = 'blue'; const lineDown = 1; - console.log = jest.fn(); + console.log = jest.fn() as jest.Mock; printRow(str, { color, lineDown }); expect(console.log).toHaveBeenCalledTimes(3); // 1 for empty line, 1 for colored string, 1 for line break - expect(console.log.mock.calls[1][0]).toEqual(chalk[color].bold(str)); + expect((console.log as jest.Mock).mock.calls[1][0]).toEqual(chalk[color].bold(str)); }); it('should not add a line break if lineDown is false', () => { @@ -110,12 +110,12 @@ describe('utils', () => { it('should print the given string in red', () => { const str = 'Error message'; - console.log = jest.fn(); + (console.log as jest.Mock).mockImplementation(() => {}); printError(str); expect(console.log).toHaveBeenCalledTimes(3); // 1 for empty line, 1 for red string, 1 for line break - expect(console.log.mock.calls[1][0]).toEqual(chalk.red.bold(str)); + expect((console.log as jest.Mock).mock.calls[1][0]).toEqual(chalk.red.bold(str)); }); });