-
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` (#927) * feat: understands `--config <FILE>` option in `conventionalChangelogArgs` * Update packages/shipjs/src/step/prepare/__tests__/updateChangelog.spec.js Co-authored-by: Haroen Viaene <[email protected]> * fix test case Co-authored-by: Eunjae Lee <[email protected]> Co-authored-by: Haroen Viaene <[email protected]> Co-authored-by: shipjs <[email protected]>
- Loading branch information
1 parent
f8a1ddb
commit 06c7226
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
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,26 @@ | ||
const path = require('path'); | ||
import { prepareParams } from '../updateChangelog'; | ||
import { parseArgs } from '../../../util'; | ||
import tempWrite from 'temp-write'; | ||
|
||
describe('prepareParams', () => { | ||
it('loads configuration from --config option', () => { | ||
parseArgs.mockImplementation(jest.requireActual('../../../util').parseArgs); | ||
const config = { | ||
writerOpts: { | ||
headerPartial: '## {{version}}', | ||
}, | ||
}; | ||
const configString = `module.exports = ${JSON.stringify(config)};`; | ||
const configPath = tempWrite.sync(configString); | ||
const configDir = path.basename(path.dirname(configPath)); | ||
|
||
const { args } = prepareParams({ | ||
dir: configDir, | ||
conventionalChangelogArgs: `-i CHANGELOG.md -s --config ${configPath}`, | ||
revisionRange: '1.0.0..1.0.1', | ||
reject: () => {}, | ||
}); | ||
expect(args.config).toEqual(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