diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b3b114..46f7def 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Features +- make changelog ignored scopes configurable [d34a9f12](https://github.com/lekterable/perfekt/commit/d34a9f12500df6ea21a17b85b783a41b1fca5347) - make changelog groups configurable [a2ec46eb](https://github.com/lekterable/perfekt/commit/a2ec46eb9e962a79a9153300adc2229af182d4a6) # 1.1.0 diff --git a/bin/perfekt.js b/bin/perfekt.js index 4c006c3..c3a07f3 100755 --- a/bin/perfekt.js +++ b/bin/perfekt.js @@ -17,7 +17,9 @@ program ...cosmiConfig.config } - changelog(version, options, config) + changelog(version, options, config).catch(error => + console.error(error.message) + ) }) program @@ -35,7 +37,9 @@ program ...cosmiConfig.config } - release(version, options, config) + release(version, options, config).catch(error => + console.error(error.message) + ) }) program.version(version).parse(process.argv) diff --git a/src/release.js b/src/release.js index 56203cd..67783d2 100644 --- a/src/release.js +++ b/src/release.js @@ -7,13 +7,9 @@ export const release = async (version, options, config) => { const newVersion = semver.valid(semver.coerce(version)) - if (!newVersion) throw new Error(`Version '${version}' doesnt look right`) + if (!newVersion) throw new Error(`Version '${version}' doesn't look right`) - try { - await updateVersion(newVersion) - await changelog(newVersion, { write: true }, config) - await commitRelease(newVersion) - } catch (error) { - console.error(error) - } + await updateVersion(newVersion) + await changelog(newVersion, { write: true }, config) + await commitRelease(newVersion) } diff --git a/src/release.test.js b/src/release.test.js index dfaa8e6..054fc1d 100644 --- a/src/release.test.js +++ b/src/release.test.js @@ -25,24 +25,10 @@ describe('release', () => { const mockedVersion = 'version' expect(release(mockedVersion)).rejects.toThrow( - "Version 'version' doesnt look right" + "Version 'version' doesn't look right" ) }) - it('should log error if it occurs', async () => { - const mockedVersion = '2.2.2' - const consoleSpy = jest.spyOn(console, 'error').mockImplementation() - - updateVersion.mockImplementation(() => Promise.reject(new Error())) - - await release(mockedVersion) - - expect(consoleSpy).toBeCalledTimes(1) - expect(consoleSpy).toBeCalledWith(expect.any(Error)) - - consoleSpy.mockRestore() - }) - it('should execute release', async () => { const mockedVersion = '2.2.2'