Skip to content

Commit

Permalink
πŸ› Fix E2E tests and semver validation error type (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredericbonnet authored Jun 9, 2023
1 parent 305a371 commit d0edd29
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/gitmoji-changelog-cli/src/cli.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ describe('generate changelog', () => {
})

async function makeChanges(fileName) {
fs.writeFileSync(path.join(testDir, fileName))
fs.writeFileSync(path.join(testDir, fileName), '')
}

async function makeCustomConfig(config) {
Expand Down
4 changes: 2 additions & 2 deletions packages/gitmoji-changelog-cli/src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const semver = require('semver')
const semverCompare = require('semver-compare')
const rc = require('rc')

const { generateChangelog, logger } = require('@gitmoji-changelog/core')
const { generateChangelog, logger, FunctionalError } = require('@gitmoji-changelog/core')
const { buildMarkdownFile, getLatestVersion } = require('@gitmoji-changelog/markdown')

const issueReporter = require('issue-reporter')
Expand Down Expand Up @@ -138,7 +138,7 @@ async function getChangelog(options, projectInfo) {
const release = options.release === 'from-package' ? projectInfo.version : options.release

if (!semver.valid(release)) {
throw new Error(`${release} is not a valid semver version.`)
throw new FunctionalError(`${release} is not a valid semver version.`)
}

const enhancedOptions = {
Expand Down
1 change: 1 addition & 0 deletions packages/gitmoji-changelog-core/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,4 +187,5 @@ function getLastCommitDate(commits) {
module.exports = {
generateChangelog,
logger,
FunctionalError,
}

0 comments on commit d0edd29

Please sign in to comment.