File tree 2 files changed +67
-5
lines changed
2 files changed +67
-5
lines changed Original file line number Diff line number Diff line change @@ -29,11 +29,11 @@ config:
29
29
commands :
30
30
[]
31
31
# - npm install
32
- # # App versions helps to ensure compatability with the Extension
33
- appVersions :
34
- {}
35
- # # Ensure compatability with a minimal VSCode CodeRoad version
36
- # vscode: '>=0.7.0'
32
+ # # App versions helps to ensure compatability with the Extension
33
+ appVersions :
34
+ {}
35
+ # # Ensure compatability with a minimal VSCode CodeRoad version
36
+ # vscode: '>=0.7.0'
37
37
# # Repo information to load code from
38
38
# #
39
39
repo :
Original file line number Diff line number Diff line change @@ -181,4 +181,66 @@ levels:
181
181
expect ( result . summary . description ) . toBe ( expected . summary . description ) ;
182
182
expect ( result . levels [ 0 ] . content ) . toBe ( expected . levels [ 0 ] . content ) ;
183
183
} ) ;
184
+
185
+ it ( "should parse the tutorial config" , ( ) => {
186
+ const md = `# Title
187
+
188
+ Description.
189
+ ` ;
190
+ const yaml = `
191
+ config:
192
+ testRunner:
193
+ command: ./node_modules/.bin/mocha
194
+ args:
195
+ filter: --grep
196
+ tap: --reporter=mocha-tap-reporter
197
+ directory: coderoad
198
+ setup:
199
+ commits:
200
+ - abcdefg1
201
+ commands: []
202
+ appVersions:
203
+ vscode: '>=0.7.0'
204
+ repo:
205
+ uri: https://path.to/repo
206
+ branch: aBranch
207
+ dependencies:
208
+ - name: node
209
+ version: '>=10'
210
+ ` ;
211
+ const result = parse ( md , yaml ) ;
212
+ const expected = {
213
+ summary : {
214
+ description : "Description.\n\nSecond description line" ,
215
+ } ,
216
+ config : {
217
+ testRunner : {
218
+ command : "./node_modules/.bin/mocha" ,
219
+ args : {
220
+ filter : "--grep" ,
221
+ tap : "--reporter=mocha-tap-reporter" ,
222
+ } ,
223
+ directory : "coderoad" ,
224
+ setup : {
225
+ commits : [ "abcdefg1" ] ,
226
+ commands : [ ] ,
227
+ } ,
228
+ } ,
229
+ repo : {
230
+ uri : "https://path.to/repo" ,
231
+ branch : "aBranch" ,
232
+ } ,
233
+ dependencies : [
234
+ {
235
+ name : "node" ,
236
+ version : ">=10" ,
237
+ } ,
238
+ ] ,
239
+ appVersions : {
240
+ vscode : ">=0.7.0" ,
241
+ } ,
242
+ } ,
243
+ } ;
244
+ expect ( result . config ) . toEqual ( expected . config ) ;
245
+ } ) ;
184
246
} ) ;
You can’t perform that action at this time.
0 commit comments