@@ -625,4 +625,64 @@ suite('extractVersionFromOutput', () => {
625625 const result = detect . extractVersionFromOutput ( output ) ;
626626 assert . strictEqual ( result , '1.0.0-beta.1' ) ;
627627 } ) ;
628+
629+ test ( 'should not extract version from file paths in error responses (issue #286)' , ( ) => {
630+ const output = `info 1 error responses loaded from /opt/homebrew/Cellar/dev-proxy/v0.29.1/devproxy-errors.json` ;
631+
632+ const result = detect . extractVersionFromOutput ( output ) ;
633+ assert . strictEqual ( result , '' ) ;
634+ } ) ;
635+
636+ test ( 'should extract version from update notification line, ignoring file paths (issue #286)' , ( ) => {
637+ const output = `info 1 error responses loaded from /opt/homebrew/Cellar/dev-proxy/v0.29.0/devproxy-errors.json
638+ info v0.29.1` ;
639+
640+ const result = detect . extractVersionFromOutput ( output ) ;
641+ assert . strictEqual ( result , '0.29.1' ) ;
642+ } ) ;
643+
644+ test ( 'should not extract version from Windows file paths' , ( ) => {
645+ const output = `info 1 error responses loaded from C:\\Program Files\\dev-proxy\\v0.29.1\\devproxy-errors.json` ;
646+
647+ const result = detect . extractVersionFromOutput ( output ) ;
648+ assert . strictEqual ( result , '' ) ;
649+ } ) ;
650+
651+ test ( 'should extract version from actual update notification with Windows paths in earlier lines' , ( ) => {
652+ const output = `info 1 error responses loaded from C:\\Program Files\\dev-proxy\\v0.29.0\\devproxy-errors.json
653+ info v0.29.1` ;
654+
655+ const result = detect . extractVersionFromOutput ( output ) ;
656+ assert . strictEqual ( result , '0.29.1' ) ;
657+ } ) ;
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+ } ) ;
628688} ) ;
0 commit comments