Skip to content

Commit d446564

Browse files
Copilotgarrytrinder
andcommitted
Add comprehensive test coverage for beta version extraction (issue #286)
Co-authored-by: garrytrinder <11563347+garrytrinder@users.noreply.github.com>
1 parent e31b4bf commit d446564

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

src/test/extension.test.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,4 +655,34 @@ info v0.29.1`;
655655
const result = detect.extractVersionFromOutput(output);
656656
assert.strictEqual(result, '0.29.1');
657657
});
658+
659+
test('should not extract beta version from Unix file paths (issue #286)', () => {
660+
const output = `info 1 error responses loaded from /opt/homebrew/Cellar/dev-proxy/v0.30.0-beta.2/devproxy-errors.json`;
661+
662+
const result = detect.extractVersionFromOutput(output);
663+
assert.strictEqual(result, '');
664+
});
665+
666+
test('should not extract beta version from Windows file paths (issue #286)', () => {
667+
const output = `info 1 error responses loaded from C:\\Program Files\\dev-proxy\\v0.30.0-beta.2\\devproxy-errors.json`;
668+
669+
const result = detect.extractVersionFromOutput(output);
670+
assert.strictEqual(result, '');
671+
});
672+
673+
test('should extract beta version from update notification, ignoring file paths (issue #286)', () => {
674+
const output = `info 1 error responses loaded from /opt/homebrew/Cellar/dev-proxy/v0.30.0-beta.1/devproxy-errors.json
675+
info v0.30.0-beta.2`;
676+
677+
const result = detect.extractVersionFromOutput(output);
678+
assert.strictEqual(result, '0.30.0-beta.2');
679+
});
680+
681+
test('should extract beta version from update notification with Windows paths in earlier lines (issue #286)', () => {
682+
const output = `info 1 error responses loaded from C:\\Program Files\\dev-proxy\\v0.30.0-beta.1\\devproxy-errors.json
683+
info v0.30.0-beta.2`;
684+
685+
const result = detect.extractVersionFromOutput(output);
686+
assert.strictEqual(result, '0.30.0-beta.2');
687+
});
658688
});

0 commit comments

Comments
 (0)