@@ -123,6 +123,8 @@ describe('crossFileContextUtil', function () {
123
123
} )
124
124
125
125
describe ( 'partial support - control group' , function ( ) {
126
+ const fileExtLists : string [ ] = [ ]
127
+
126
128
before ( async function ( ) {
127
129
this . timeout ( 60000 )
128
130
userGroupSettings . userGroup = UserGroup . Control
@@ -136,25 +138,29 @@ describe('crossFileContextUtil', function () {
136
138
await closeAllEditors ( )
137
139
} )
138
140
139
- it ( 'should be empty if userGroup is control' , async function ( ) {
140
- if ( ! shouldRunTheTest ( ) ) {
141
- this . skip ( )
142
- }
141
+ fileExtLists . forEach ( fileExt => {
142
+ it ( 'should be empty if userGroup is control' , async function ( ) {
143
+ if ( ! shouldRunTheTest ( ) ) {
144
+ this . skip ( )
145
+ }
143
146
144
- const editor = await openATextEditorWithText ( 'content-1' , ' file-1.js' , tempFolder , { preview : false } )
145
- await openATextEditorWithText ( 'content-2' , ' file-2.js' , tempFolder , { preview : false } )
146
- await openATextEditorWithText ( 'content-3' , ' file-3.js' , tempFolder , { preview : false } )
147
- await openATextEditorWithText ( 'content-4' , ' file-4.js' , tempFolder , { preview : false } )
147
+ const editor = await openATextEditorWithText ( 'content-1' , ` file-1.${ fileExt } ` , tempFolder )
148
+ await openATextEditorWithText ( 'content-2' , ` file-2.${ fileExt } ` , tempFolder , { preview : false } )
149
+ await openATextEditorWithText ( 'content-3' , ` file-3.${ fileExt } ` , tempFolder , { preview : false } )
150
+ await openATextEditorWithText ( 'content-4' , ` file-4.${ fileExt } ` , tempFolder , { preview : false } )
148
151
149
- await assertTabCount ( 4 )
152
+ await assertTabCount ( 4 )
150
153
151
- const actual = await crossFile . fetchSupplementalContextForSrc ( editor , fakeCancellationToken )
154
+ const actual = await crossFile . fetchSupplementalContextForSrc ( editor , fakeCancellationToken )
152
155
153
- assert . ok ( actual !== undefined && actual . length === 0 )
156
+ assert . ok ( actual ?. length !== undefined && actual . length === 0 )
157
+ } )
154
158
} )
155
159
} )
156
160
157
161
describe ( 'partial support - crossfile group' , function ( ) {
162
+ const fileExtLists : string [ ] = [ ]
163
+
158
164
before ( async function ( ) {
159
165
this . timeout ( 60000 )
160
166
userGroupSettings . userGroup = UserGroup . CrossFile
@@ -168,25 +174,29 @@ describe('crossFileContextUtil', function () {
168
174
await closeAllEditors ( )
169
175
} )
170
176
171
- it ( 'should be non empty if userGroup is crossfile' , async function ( ) {
172
- if ( ! shouldRunTheTest ( ) ) {
173
- this . skip ( )
174
- }
177
+ fileExtLists . forEach ( fileExt => {
178
+ it ( 'should be non empty if usergroup is Crossfile' , async function ( ) {
179
+ if ( ! shouldRunTheTest ( ) ) {
180
+ this . skip ( )
181
+ }
175
182
176
- const editor = await openATextEditorWithText ( 'content-1' , ' file-1.js' , tempFolder , { preview : false } )
177
- await openATextEditorWithText ( 'content-2' , ' file-2.js' , tempFolder , { preview : false } )
178
- await openATextEditorWithText ( 'content-3' , ' file-3.js' , tempFolder , { preview : false } )
179
- await openATextEditorWithText ( 'content-4' , ' file-4.js' , tempFolder , { preview : false } )
183
+ const editor = await openATextEditorWithText ( 'content-1' , ` file-1.${ fileExt } ` , tempFolder )
184
+ await openATextEditorWithText ( 'content-2' , ` file-2.${ fileExt } ` , tempFolder , { preview : false } )
185
+ await openATextEditorWithText ( 'content-3' , ` file-3.${ fileExt } ` , tempFolder , { preview : false } )
186
+ await openATextEditorWithText ( 'content-4' , ` file-4.${ fileExt } ` , tempFolder , { preview : false } )
180
187
181
- await assertTabCount ( 4 )
188
+ await assertTabCount ( 4 )
182
189
183
- const actual = await crossFile . fetchSupplementalContextForSrc ( editor , fakeCancellationToken )
190
+ const actual = await crossFile . fetchSupplementalContextForSrc ( editor , fakeCancellationToken )
184
191
185
- assert . ok ( actual !== undefined && actual . length !== 0 )
192
+ assert . ok ( actual ?. length !== undefined && actual . length !== 0 )
193
+ } )
186
194
} )
187
195
} )
188
196
189
197
describe ( 'full support' , function ( ) {
198
+ const fileExtLists = [ 'java' , 'js' , 'ts' , 'py' , 'tsx' , 'jsx' ]
199
+
190
200
before ( async function ( ) {
191
201
this . timeout ( 60000 )
192
202
} )
@@ -200,21 +210,23 @@ describe('crossFileContextUtil', function () {
200
210
await closeAllEditors ( )
201
211
} )
202
212
203
- it ( 'should be non empty' , async function ( ) {
204
- if ( ! shouldRunTheTest ( ) ) {
205
- this . skip ( )
206
- }
213
+ fileExtLists . forEach ( fileExt => {
214
+ it ( 'should be non empty' , async function ( ) {
215
+ if ( ! shouldRunTheTest ( ) ) {
216
+ this . skip ( )
217
+ }
207
218
208
- const editor = await openATextEditorWithText ( 'content-1' , ' file-1.java' , tempFolder )
209
- await openATextEditorWithText ( 'content-2' , ' file-2.java' , tempFolder , { preview : false } )
210
- await openATextEditorWithText ( 'content-3' , ' file-3.java' , tempFolder , { preview : false } )
211
- await openATextEditorWithText ( 'content-4' , ' file-4.java' , tempFolder , { preview : false } )
219
+ const editor = await openATextEditorWithText ( 'content-1' , ` file-1.${ fileExt } ` , tempFolder )
220
+ await openATextEditorWithText ( 'content-2' , ` file-2.${ fileExt } ` , tempFolder , { preview : false } )
221
+ await openATextEditorWithText ( 'content-3' , ` file-3.${ fileExt } ` , tempFolder , { preview : false } )
222
+ await openATextEditorWithText ( 'content-4' , ` file-4.${ fileExt } ` , tempFolder , { preview : false } )
212
223
213
- await assertTabCount ( 4 )
224
+ await assertTabCount ( 4 )
214
225
215
- const actual = await crossFile . fetchSupplementalContextForSrc ( editor , fakeCancellationToken )
226
+ const actual = await crossFile . fetchSupplementalContextForSrc ( editor , fakeCancellationToken )
216
227
217
- assert . ok ( actual ?. length !== undefined && actual . length !== 0 )
228
+ assert . ok ( actual ?. length !== undefined && actual . length !== 0 )
229
+ } )
218
230
} )
219
231
} )
220
232
} )
0 commit comments