Commit 91c8e34
authored
fix(codegen): skip assertions that depend on an unmapped do-step (#191)
Assertions (match/is_*/length/comparison/contains) and `set` steps
read $RESPONSE, which is written by the preceding `do`. When a
do-step is skipped — because the CLI action isn't registered or the
catch clause is unsupported — $RESPONSE is stale or empty, so
downstream assertions would run against the wrong data and emit
spurious failures like:
FAIL: expected queries = [object Object]
FAIL: expected acknowledged = true
renderSteps now tracks whether the most recent do produced a response
and emits a skip-comment for any assertion/set that follows a skipped
do, until the next executed do resets the response. renderDo returns
a boolean so the caller knows whether to trust $RESPONSE.
Closes #1891 parent 9245d80 commit 91c8e34
3 files changed
Lines changed: 74 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
143 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
144 | 161 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | 162 | | |
149 | 163 | | |
150 | 164 | | |
| |||
169 | 183 | | |
170 | 184 | | |
171 | 185 | | |
172 | | - | |
173 | | - | |
174 | 186 | | |
175 | 187 | | |
176 | 188 | | |
177 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
178 | 196 | | |
179 | 197 | | |
180 | 198 | | |
181 | 199 | | |
182 | 200 | | |
183 | 201 | | |
184 | | - | |
| 202 | + | |
185 | 203 | | |
186 | 204 | | |
187 | | - | |
| 205 | + | |
188 | 206 | | |
189 | 207 | | |
190 | 208 | | |
| |||
195 | 213 | | |
196 | 214 | | |
197 | 215 | | |
198 | | - | |
| 216 | + | |
199 | 217 | | |
200 | 218 | | |
201 | 219 | | |
| |||
205 | 223 | | |
206 | 224 | | |
207 | 225 | | |
| 226 | + | |
208 | 227 | | |
209 | 228 | | |
210 | 229 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
176 | 208 | | |
177 | 209 | | |
178 | 210 | | |
| |||
0 commit comments