Skip to content

Commit 65a6006

Browse files
committed
fix: Correct NodeUpdater tests and update changelog
- Ensured `manifestPath` is properly set in NodeUpdater tests to prevent failures. - Added a changelog entry for the test fix." (Committing the staged changes.)
1 parent 197c68a commit 65a6006

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ All notable changes for each version of the Ambient Music extension.
1212
- feat: Introduce custom error types for granular error handling
1313
- refactor: Extract Git operations into a separate utility
1414
- Refactor: Centralized file handling operations by introducing a new FileHandler utility. This improves consistency and maintainability across different updaters.
15+
- fix: Corrected NodeUpdater tests by ensuring manifestPath is set.
1516

1617
## v0.7.0 2025 08 24
1718

tests/nodeUpdater.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ describe('NodeUpdater', () => {
5757
describe('getCurrentVersion', () => {
5858
it('should return the version from package.json if it exists', () => {
5959
(existsSync as vi.Mock).mockReturnValue(true);
60+
nodeUpdater.canHandle(); // Ensure manifestPath is set
6061
(readFileSync as vi.Mock).mockReturnValueOnce(JSON.stringify({ version: '1.0.0' }));
6162
expect(nodeUpdater.getCurrentVersion()).toBe('1.0.0');
6263
expect(readFileSync).toHaveBeenCalledWith('package.json', 'utf8');
@@ -79,6 +80,8 @@ describe('NodeUpdater', () => {
7980
});
8081

8182
it('should increment the version and write to package.json', () => {
83+
(existsSync as vi.Mock).mockReturnValue(true);
84+
nodeUpdater.canHandle();
8285
const result = nodeUpdater.bumpVersion('patch');
8386

8487
expect(inc).toHaveBeenCalledWith(mockPackageJson.version, 'patch');
@@ -90,6 +93,8 @@ describe('NodeUpdater', () => {
9093
});
9194

9295
it('should handle major release type', () => {
96+
(existsSync as vi.Mock).mockReturnValue(true);
97+
nodeUpdater.canHandle();
9398
const majorVersion = '2.0.0';
9499
(inc as vi.Mock).mockReturnValue(majorVersion);
95100
const result = nodeUpdater.bumpVersion('major');
@@ -98,6 +103,8 @@ describe('NodeUpdater', () => {
98103
});
99104

100105
it('should handle minor release type', () => {
106+
(existsSync as vi.Mock).mockReturnValue(true);
107+
nodeUpdater.canHandle();
101108
const minorVersion = '1.1.0';
102109
(inc as vi.Mock).mockReturnValue(minorVersion);
103110
const result = nodeUpdater.bumpVersion('minor');

0 commit comments

Comments
 (0)