File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,41 @@ describe('extension downloading', () => {
170
170
expect ( requestMock ) . toHaveBeenCalledTimes ( 2 ) ;
171
171
expect ( decompressMock ) . toHaveBeenCalledTimes ( 2 ) ;
172
172
} ) ;
173
+
174
+ it ( 'can download an extension to a custom location' , async ( ) => {
175
+ const plugin = createPlugin ( ) ;
176
+ // @ts -ignore
177
+ const requestMock = request . get . mockImplementation ( ( _ , __ , cb ) => {
178
+ cb ( null , { statusCode : 200 , headers : { } } , Buffer . from ( '' ) ) ;
179
+ } ) ;
180
+ // @ts -ignore
181
+ const decompressMock = decompress . mockImplementation ( jest . fn ( ) ) ;
182
+ // @ts -ignore
183
+ utils . requireJson . mockImplementation ( ( ) => ( {
184
+ contributes : {
185
+ languages : [ {
186
+ id : 'custom' ,
187
+ } ] ,
188
+ grammars : [ {
189
+ language : 'custom' ,
190
+ scopeName : 'source.custom' ,
191
+ path : `../../../../../../custom.tmLanguage.json`
192
+ } ] ,
193
+ }
194
+ } ) ) ;
195
+
196
+ return plugin ( {
197
+ markdownAST : createMarkdownAST ( 'custom' ) ,
198
+ markdownNode,
199
+ cache : createCache ( ) ,
200
+ } , {
201
+ extensionDataDirectory : path . resolve ( __dirname , 'extensions/one/two/three' ) ,
202
+ extensions : [ {
203
+ identifier : 'publisher.custom-language' ,
204
+ version : '1.0.0' ,
205
+ } ] ,
206
+ } ) ;
207
+ } ) ;
173
208
} ) ;
174
209
175
210
it ( 'sets highlighted line class names' , async ( ) => {
You can’t perform that action at this time.
0 commit comments