4
4
*--------------------------------------------------------------------------------------------*/
5
5
6
6
import { strictEqual } from 'assert' ;
7
+ import { isWindows } from 'vs/base/common/platform' ;
7
8
import { OpenerService } from 'vs/editor/browser/services/openerService' ;
8
9
import { ContextMenuService } from 'vs/platform/contextview/browser/contextMenuService' ;
9
10
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView' ;
@@ -83,10 +84,11 @@ suite('ContextualActionAddon', () => {
83
84
} ) ;
84
85
} ) ;
85
86
} ) ;
86
- suite ( 'freePort' , ( ) => {
87
- const expected = new Map ( ) ;
88
- const portCommand = `yarn start dev` ;
89
- const output = `yarn run v1.22.17
87
+ if ( ! isWindows ) {
88
+ suite ( 'freePort' , ( ) => {
89
+ const expected = new Map ( ) ;
90
+ const portCommand = `yarn start dev` ;
91
+ const output = `yarn run v1.22.17
90
92
warning ../../package.json: No license field
91
93
Error: listen EADDRINUSE: address already in use 0.0.0.0:3000
92
94
at Server.setupListenHandle [as _listen2] (node:net:1315:16)
@@ -100,27 +102,29 @@ suite('ContextualActionAddon', () => {
100
102
}
101
103
error Command failed with exit code 1.
102
104
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.` ;
103
- const actionOptions = [ {
104
- id : 'terminal.freePort' ,
105
- label : 'Free port 3000' ,
106
- run : true ,
107
- tooltip : 'Free port 3000' ,
108
- enabled : true
109
- } ] ;
110
- setup ( ( ) => {
111
- const command = freePort ( terminalInstance ) ;
112
- expected . set ( command . commandLineMatcher . toString ( ) , [ command ] ) ;
113
- contextualActionAddon . registerCommandFinishedListener ( command ) ;
114
- } ) ;
115
- suite ( 'returns undefined when' , ( ) => {
116
- test ( 'output does not match' , ( ) => {
117
- strictEqual ( getMatchActions ( createCommand ( portCommand , `invalid output` , FreePortOutputRegex ) , expected ) , undefined ) ;
105
+ const actionOptions = [ {
106
+ id : 'terminal.freePort' ,
107
+ label : 'Free port 3000' ,
108
+ run : true ,
109
+ tooltip : 'Free port 3000' ,
110
+ enabled : true
111
+ } ] ;
112
+ setup ( ( ) => {
113
+ const command = freePort ( terminalInstance ) ;
114
+ expected . set ( command . commandLineMatcher . toString ( ) , [ command ] ) ;
115
+ contextualActionAddon . registerCommandFinishedListener ( command ) ;
116
+ } ) ;
117
+ suite ( 'returns undefined when' , ( ) => {
118
+ test ( 'output does not match' , ( ) => {
119
+ strictEqual ( getMatchActions ( createCommand ( portCommand , `invalid output` , FreePortOutputRegex ) , expected ) , undefined ) ;
120
+ } ) ;
121
+ } ) ;
122
+ test ( 'returns actions' , ( ) => {
123
+ assertMatchOptions ( getMatchActions ( createCommand ( portCommand , output , FreePortOutputRegex ) , expected ) , actionOptions ) ;
118
124
} ) ;
119
125
} ) ;
120
- test ( 'returns actions' , ( ) => {
121
- assertMatchOptions ( getMatchActions ( createCommand ( portCommand , output , FreePortOutputRegex ) , expected ) , actionOptions ) ;
122
- } ) ;
123
- } ) ;
126
+ }
127
+
124
128
suite ( 'gitPushSetUpstream' , ( ) => {
125
129
const expectedMap = new Map ( ) ;
126
130
const command = `git push` ;
0 commit comments