Skip to content

Commit

Permalink
fix: functional unit test failing scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptodev-2s committed Nov 28, 2023
1 parent 1939ada commit ad3101c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/functional.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ describe('create-release-branch (functional)', () => {
});

// Tests four things:
// * The latest commit should be called "Release 1.0.0"
// * The latest commit should be called "Update Release 1.0.0"
// * The latest commit should be the current commit (HEAD)
// * The latest branch should be called "release/1.0.0"
// * The latest branch should point to the latest commit
Expand All @@ -598,7 +598,7 @@ describe('create-release-branch (functional)', () => {
'--max-count=1',
])
).stdout;
expect(latestCommitSubject).toBe('Release 2.0.0');
expect(latestCommitSubject).toBe('Update Release 2.0.0');
expect(latestCommitRevs).toContain('HEAD');
expect(latestCommitRevs).toContain('release/2.0.0');
expect(latestBranchCommitId).toStrictEqual(latestCommitId);
Expand Down
13 changes: 8 additions & 5 deletions src/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,12 @@ export async function restoreUnreleasedPackagesChangelog({

return changelogPaths;
}, []);
await restoreFiles(
directoryPath,
defaultBranch,
unreleasedPackagesChangelogPaths,
);

if (unreleasedPackagesChangelogPaths.length > 0) {
await restoreFiles(
directoryPath,
defaultBranch,
unreleasedPackagesChangelogPaths,
);
}
}

0 comments on commit ad3101c

Please sign in to comment.