@@ -71,13 +71,7 @@ suite('setup for no-config debug scenario', function () {
71
71
. setup ( ( x ) => x . append ( TypeMoq . It . isAny ( ) , TypeMoq . It . isAny ( ) ) )
72
72
. callback ( ( key , value ) => {
73
73
if ( key === 'PATH' ) {
74
- // The value should be the scripts directory, with or without separator
75
- // depending on whether the current PATH ends with a separator
76
- const pathSeparator = process . platform === 'win32' ? ';' : ':' ;
77
- const currentPath = process . env . PATH || '' ;
78
- const needsSeparator = currentPath . length > 0 && ! currentPath . endsWith ( pathSeparator ) ;
79
- const expectedValue = needsSeparator ? `${ pathSeparator } ${ noConfigScriptsDir } ` : noConfigScriptsDir ;
80
- assert ( value === expectedValue ) ;
74
+ assert ( value . includes ( noConfigScriptsDir ) ) ;
81
75
}
82
76
} )
83
77
. returns ( envVarCollectionAppendStub ) ;
@@ -108,19 +102,21 @@ suite('setup for no-config debug scenario', function () {
108
102
environmentVariableCollectionMock
109
103
. setup ( ( x ) => x . replace ( TypeMoq . It . isAny ( ) , TypeMoq . It . isAny ( ) ) )
110
104
. returns ( envVarCollectionReplaceStub ) ;
111
-
105
+
112
106
environmentVariableCollectionMock
113
107
. setup ( ( x ) => x . append ( TypeMoq . It . isAny ( ) , TypeMoq . It . isAny ( ) ) )
114
108
. callback ( ( key , value ) => {
115
109
if ( key === 'PATH' ) {
116
- // When PATH already ends with separator, we should NOT add another one
110
+ // Since PATH already ends with separator, we should NOT add another one
117
111
assert ( value === noConfigScriptsDir ) ;
118
112
assert ( ! value . startsWith ( pathSeparator ) ) ;
119
113
}
120
114
} )
121
115
. returns ( envVarCollectionAppendStub ) ;
122
116
123
- context . setup ( ( c ) => c . environmentVariableCollection ) . returns ( ( ) => environmentVariableCollectionMock . object ) ;
117
+ context
118
+ . setup ( ( c ) => c . environmentVariableCollection )
119
+ . returns ( ( ) => environmentVariableCollectionMock . object ) ;
124
120
125
121
setupFileSystemWatchers ( ) ;
126
122
@@ -153,19 +149,21 @@ suite('setup for no-config debug scenario', function () {
153
149
environmentVariableCollectionMock
154
150
. setup ( ( x ) => x . replace ( TypeMoq . It . isAny ( ) , TypeMoq . It . isAny ( ) ) )
155
151
. returns ( envVarCollectionReplaceStub ) ;
156
-
152
+
157
153
environmentVariableCollectionMock
158
154
. setup ( ( x ) => x . append ( TypeMoq . It . isAny ( ) , TypeMoq . It . isAny ( ) ) )
159
155
. callback ( ( key , value ) => {
160
156
if ( key === 'PATH' ) {
161
- // When PATH does not end with separator, we should add one
157
+ // Since PATH does NOT end with separator, we should add one
162
158
assert ( value === `${ pathSeparator } ${ noConfigScriptsDir } ` ) ;
163
159
assert ( value . startsWith ( pathSeparator ) ) ;
164
160
}
165
161
} )
166
162
. returns ( envVarCollectionAppendStub ) ;
167
163
168
- context . setup ( ( c ) => c . environmentVariableCollection ) . returns ( ( ) => environmentVariableCollectionMock . object ) ;
164
+ context
165
+ . setup ( ( c ) => c . environmentVariableCollection )
166
+ . returns ( ( ) => environmentVariableCollectionMock . object ) ;
169
167
170
168
setupFileSystemWatchers ( ) ;
171
169
0 commit comments