@@ -87,11 +87,11 @@ The above example will open the "README.md" file in the users workspace. Note th
87
87
88
88
# ## `filter` (string)
89
89
90
- A regex passed into the test runner to limit the tests returned
90
+ A glob passed into the test runner to limit the tests returned.
91
91
92
92
` ` ` yaml
93
93
setup:
94
- filter: 'level_1_tests '
94
+ filter: 'tests/{level1, level2}/* '
95
95
` ` `
96
96
97
97
Will restrict tests to only run a subset of tests that match the filter. Filter depends on your test runner, and can be configured in the test runner.
@@ -106,6 +106,48 @@ config:
106
106
107
107
Essentially, the above example will run `./node_modules/.bin/mocha --grep level_1_tests` as the test command.
108
108
109
- # ## ` subtasks` (boolean)
109
+ # ## subtasks
110
110
111
- A task made up of multiple other tests where all must pass to continue
111
+ A task made up of multiple other tests where all must pass to continue.
112
+
113
+ 
114
+
115
+ See an [example](https://github.com/shmck/coderoad-tutorial-subtask-demo).
116
+
117
+ Subtasks do not require any config, but may be written in the TUTORIAL.md with corresponding test names.
118
+
119
+ # #### 1. Add the subtask titles to the TUTORIAL.md
120
+
121
+ ` ` ` md
122
+ ## 1. Subtask Example
123
+
124
+ A subtask example
125
+
126
+ ### 1.1
127
+
128
+ Create a function ` add` that can take a variety of params.
129
+
130
+ # ### SUBTASKS
131
+
132
+ - Add one number
133
+ - Add two numbers
134
+ - Add three numbers
135
+ ` ` `
136
+
137
+ ##### 2. Label the tests with ` :#`
138
+
139
+ As an example, the below test corresponds to the index of the first subtask ("Add one number").
140
+
141
+ ` ` ` js
142
+ it(':1 should add one number', function () {
143
+ const result = add(1) === 1
144
+ const message = 'Should accept a single param'
145
+ assert.ok(result, message)
146
+ const result2 = add(42) === 42
147
+ assert.ok(result2, message)
148
+ })
149
+ ` ` `
150
+
151
+ See [an example subtask test file](https://github.com/ShMcK/coderoad-tutorial-subtask-demo/blob/v0.2.1/.coderoad/test/add.test.js) for more.
152
+
153
+ The number of subtasks should match the number of tests being run. If this is not the case, use [filter](#filter-string) to limit the tests.
0 commit comments