Skip to content

Commit

Permalink
revert: "fix(preset-loader): fix handling conventionalcommits preset …
Browse files Browse the repository at this point in the history
…without config object" (#520)

This reverts commit 6425972.
  • Loading branch information
tommywo committed Sep 7, 2019
1 parent a3acc32 commit 417139c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
13 changes: 0 additions & 13 deletions packages/conventional-changelog-cli/test/test.js
Expand Up @@ -367,19 +367,6 @@ describe('cli', function () {
done()
}))
})
it('--preset "conventionalcommits" should work', function (done) {
writeFileSync('angular', '')
shell.exec('git add --all && git commit -m"fix: fix it!"')
var cp = spawn(cliPath, ['--preset', 'conventionalcommits'], {
stdio: [process.stdin, null, null]
})

cp.stdout
.pipe(concat(function (chunk) {
expect(chunk.toString()).to.include('Bug Fixes')
done()
}))
})

it('--config should work with --preset', function (done) {
var cp = spawn(cliPath, ['--preset', 'angular', '--config', path.join(__dirname, 'fixtures/config.js')], {
Expand Down
5 changes: 2 additions & 3 deletions packages/conventional-changelog-preset-loader/index.js
Expand Up @@ -33,9 +33,8 @@ function presetLoader (requireMethod) {
// rather than returning a promise, presets can return a builder function
// which accepts a config object (allowing for customization) and returns
// a promise.
if (config && !config.then) {
const options = typeof path === 'object' ? path : {}
return config(options)
if (config && !config.then && typeof path === 'object') {
return config(path)
} else {
// require returned a promise that resolves to a config object.
return config
Expand Down

0 comments on commit 417139c

Please sign in to comment.