diff --git a/src/commands/commit/withClient/index.js b/src/commands/commit/withClient/index.js index c99742b30..2bc9e37f8 100644 --- a/src/commands/commit/withClient/index.js +++ b/src/commands/commit/withClient/index.js @@ -37,8 +37,12 @@ const withClient = async (answers: Answers) => { } catch (error) { console.error( chalk.red( - '\nOops! An error ocurred. There is likely additional logging output above.\n' - ) + '\n', + 'Oops! An error ocurred. There is likely additional logging output above.\n', + 'You can run the same commit with this command:\n' + ), + '\t', + error.escapedCommand ) } } diff --git a/test/commands/commit.spec.js b/test/commands/commit.spec.js index 8fa28d5de..1433ca489 100644 --- a/test/commands/commit.spec.js +++ b/test/commands/commit.spec.js @@ -1,6 +1,7 @@ import inquirer from 'inquirer' import execa from 'execa' import fs from 'fs' +import chalk from 'chalk' const mockProcess = require('jest-mock-process') import configurationVault from '../../src/utils/configurationVault' @@ -143,7 +144,15 @@ describe('commit command', () => { }) it('should print the error to the console', () => { - expect(consoleError).toHaveBeenCalledWith(expect.any(String)) + expect(consoleError).toHaveBeenCalledWith( + chalk.red( + '\n', + 'Oops! An error ocurred. There is likely additional logging output above.\n', + 'You can run the same commit with this command:\n' + ), + '\t', + undefined + ) }) }) })