fix(learn): Convert response testcase regex handles any variable name (#40568)
* Update convert response to JSON testcase Testcase previously required that variable be named exactly "response". Changes will allow variable of any name to be used. Example: res can now be used and tests still pass. * Forgot the \ in front of )
This commit is contained in:
parent
8a9f3319c6
commit
0a7aa59d51
@ -49,7 +49,7 @@ Your code should use `then` to convert the response to JSON.
|
||||
```js
|
||||
assert(
|
||||
code.match(
|
||||
/\.then\s*\(\s*(response|\(\s*response\s*\))\s*=>\s*response\s*\.json\s*\(\s*\)\s*\)/g
|
||||
/\.then\s*\(\s*\(?(?<var>\w+)\)?\s*=>\s*\k<var>\s*\.json\s*\(\s*\)\s*\)/g
|
||||
)
|
||||
);
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user