From 0a7aa59d51f18e9105ca83074e3e06f87acbe5d4 Mon Sep 17 00:00:00 2001 From: Durbatuluk1701 <52861844+Durbatuluk1701@users.noreply.github.com> Date: Thu, 21 Jan 2021 10:54:24 -0600 Subject: [PATCH] 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 ) --- .../get-json-with-the-javascript-fetch-method.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curriculum/challenges/english/04-data-visualization/json-apis-and-ajax/get-json-with-the-javascript-fetch-method.md b/curriculum/challenges/english/04-data-visualization/json-apis-and-ajax/get-json-with-the-javascript-fetch-method.md index 1335f06f4e..17e36e60a1 100644 --- a/curriculum/challenges/english/04-data-visualization/json-apis-and-ajax/get-json-with-the-javascript-fetch-method.md +++ b/curriculum/challenges/english/04-data-visualization/json-apis-and-ajax/get-json-with-the-javascript-fetch-method.md @@ -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*\(?(?\w+)\)?\s*=>\s*\k\s*\.json\s*\(\s*\)\s*\)/g ) ); ```