-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: understands
--config <FILE>
option in `conventionalChangelogA…
…rgs`
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
packages/shipjs/src/step/prepare/__tests__/updateChangelog.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const path = require('path'); | ||
import prepareParams from '../updateChangelog'; | ||
import tempWrite from 'temp-write'; | ||
|
||
describe('prepareParams', () => { | ||
it('loads configuration from --config option', () => { | ||
const config = { | ||
writerOpts: { | ||
headerPartial: '## {{version}}', | ||
}, | ||
}; | ||
const configString = `module.exports = { ${config} };`; | ||
const configPath = tempWrite.sync(configString); | ||
const configDir = path.basename(path.dirname(configPath)); | ||
|
||
const { args } = prepareParams({ | ||
dir: configDir, | ||
conventionalChangelogArgs: `--config ${configPath}`, | ||
revisionRange: '1.0.0..1.0.1', | ||
reject: () => {}, | ||
}); | ||
expect(args.config).toMatch(config); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters