diff --git a/curriculum/challenges/english/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md b/curriculum/challenges/english/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md index ae0e6ed4a7f..d090b2f0c10 100644 --- a/curriculum/challenges/english/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md +++ b/curriculum/challenges/english/blocks/lab-weather-app/66f12a88741aeb16b9246c59.md @@ -660,28 +660,26 @@ const temp1 = fetch; const temp2 = console.log; const temp3 = console.error; const temp4 = alert; -async () => { - try { - alert = () => {}; - console.log = obj => { - testArr.push(obj.toString()); - }; - console.error = obj => { - testArr.push(obj.toString()); - }; - fetch = source => { - throw new Error('This is a test error'); - }; - await getWeather('chicago'); - assert.include(testArr[0], 'This is a test error'); - assert.lengthOf(testArr, 1); - } finally { - fetch = temp1; - console.log = temp2; - console.error = temp3; - alert = temp4; - } -}; +try { + alert = () => {}; + console.log = obj => { + testArr.push(obj.toString()); + }; + console.error = obj => { + testArr.push(obj.toString()); + }; + fetch = source => { + throw new Error('This is a test error'); + }; + await getWeather('chicago'); + assert.include(testArr[0], 'This is a test error'); + assert.lengthOf(testArr, 1); +} finally { + fetch = temp1; + console.log = temp2; + console.error = temp3; + alert = temp4; +} ``` When Paris is selected the app should show an alert with `Something went wrong, please try again later`. @@ -689,21 +687,19 @@ When Paris is selected the app should show an alert with `Something went wrong, ```js const testArr = []; const temp4 = alert; -async () => { - try { - alert = msg => { - testArr.push(msg); - }; - const city = 'paris'; - document.querySelector('select').value = city; - document.querySelector('#get-weather-btn').click(); - await new Promise(resolve => setTimeout(resolve, 1)); - assert.include(testArr[0], 'Something went wrong, please try again later'); - assert.lengthOf(testArr, 1); - } finally { - alert = temp4; - } -}; +try { + alert = msg => { + testArr.push(msg); + }; + const city = 'paris'; + document.querySelector('select').value = city; + document.querySelector('#get-weather-btn').click(); + await new Promise(resolve => setTimeout(resolve, 1)); + assert.include(testArr[0], 'Something went wrong, please try again later'); + assert.lengthOf(testArr, 1); +} finally { + alert = temp4; +} ``` # --seed--