Skip to content

Commit

Permalink
Explicit preset objects in tests + migrate error message
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Sep 4, 2023
1 parent c37a7ea commit c4e90e0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test.js
Expand Up @@ -28,7 +28,7 @@ const log = {

const namespace = 'conventional-changelog';
const { pathname } = new URL('./index.js', import.meta.url);
const preset = 'angular';
const preset = { name: 'angular' };

const getOptions = options => [
{
Expand Down Expand Up @@ -212,7 +212,12 @@ test('should follow strict semver (pre-release continuation, conventionalcommits
sh.exec(`git add file`);
sh.exec(`git commit -m "feat: new feature"`);

const [config, container] = getOptions({ preset: 'conventionalcommits', strictSemVer: true });
const [config, container] = getOptions({
preset: { name: 'conventionalcommits' },
strictSemVer: true,
writerOpts: {},
parserOpts: {}
});
config.preRelease = 'alpha';
const { version } = await runTasks(config, container);
assert.equal(version, '2.1.0-alpha.0');
Expand Down Expand Up @@ -296,7 +301,7 @@ test('should reject if conventional bump passes error', async () => {
test('should reject if conventional changelog has error', async () => {
setup();
const options = getOptions({ preset: () => {} });
await assert.rejects(runTasks(...options), /preset must be string or object with key name/);
await assert.rejects(runTasks(...options), /preset must be string or object with property `name`/i);
});

test('should not write infile in dry run', async () => {
Expand Down

0 comments on commit c4e90e0

Please sign in to comment.