Skip to content

Commit

Permalink
fix: 🐞 add tag prefix in independent mode
Browse files Browse the repository at this point in the history
Closes #34
  • Loading branch information
edbzn committed Dec 31, 2020
1 parent 9167cef commit e690d37
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/semver/src/builders/version/builder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ describe('@jscutlery/semver:version', () => {
beforeEach(async () => {
context = await getMockContext();
context.logger.error = jest.fn();
context.target.project = 'lib';
context.getProjectMetadata = jest
.fn()
.mockResolvedValue({ root: '/root/packages/lib' });
Expand Down Expand Up @@ -132,6 +133,7 @@ describe('@jscutlery/semver:version', () => {
dryRun: false,
noVerify: false,
firstRelease: false,
tagPrefix: 'lib',
path: '/root/packages/lib',
infile: '/root/packages/lib/CHANGELOG.md',
bumpFiles: ['/root/packages/lib/package.json'],
Expand All @@ -142,11 +144,12 @@ describe('@jscutlery/semver:version', () => {
});

describe('Sync versions', () => {
beforeEach(async () => {
beforeEach(() => {
/* With the sync versions, the builder runs on the workspace. */
(context.getProjectMetadata as jest.MockedFunction<
typeof context.getProjectMetadata
>).mockResolvedValue({ root: '/root' });
context.target.project = 'workspace';
});

it('should run standard-version on multiple projects', async () => {
Expand All @@ -172,6 +175,7 @@ describe('@jscutlery/semver:version', () => {
dryRun: false,
noVerify: false,
firstRelease: false,
tagPrefix: null,
path: '/root',
infile: '/root/CHANGELOG.md',
bumpFiles: [
Expand Down
1 change: 1 addition & 0 deletions packages/semver/src/builders/version/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export function runBuilder(
dryRun,
noVerify,
firstRelease,
tagPrefix: syncVersions === false ? context.target.project : null,
infile: resolve(projectRoot, 'CHANGELOG.md'),
packageFiles: [resolve(projectRoot, 'package.json')],
bumpFiles,
Expand Down

0 comments on commit e690d37

Please sign in to comment.