mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(curriculum): delay asserts for promise chaining (#65323)
This commit is contained in:
@@ -302,6 +302,11 @@ const helper = (wobj) => ({
|
||||
"weather-main": wobj.weather[0].main || "N/A",
|
||||
location: wobj.name || "N/A",
|
||||
});
|
||||
|
||||
const timeout = milliseconds =>
|
||||
new Promise(resolve => {
|
||||
return setTimeout(resolve, milliseconds)
|
||||
});
|
||||
```
|
||||
|
||||
# --hints--
|
||||
@@ -494,6 +499,7 @@ When New York is selected the `showWeather` function should display the data fro
|
||||
// construct the object from the data from the API
|
||||
const extractedData = helper(body);
|
||||
|
||||
await timeout(1)
|
||||
// check that all things are in place
|
||||
for (const id in extractedData) {
|
||||
if (id === 'weather-icon') {
|
||||
@@ -529,6 +535,7 @@ When Chicago is selected the `showWeather` function should display the data from
|
||||
// construct the object from the data from the API
|
||||
const extractedData = helper(body);
|
||||
|
||||
await timeout(1)
|
||||
// check that all things are in place
|
||||
for (const id in extractedData) {
|
||||
if (id === 'weather-icon') {
|
||||
@@ -564,6 +571,7 @@ When London is selected the `showWeather` function should display the data from
|
||||
// construct the object from the data from the API
|
||||
const extractedData = helper(body);
|
||||
|
||||
await timeout(1)
|
||||
// check that all things are in place
|
||||
for (const id in extractedData) {
|
||||
if (id === 'weather-icon') {
|
||||
@@ -599,6 +607,7 @@ When Tokyo is selected the `showWeather` function should display the data from t
|
||||
// construct the object from the data from the API
|
||||
const extractedData = helper(body);
|
||||
|
||||
await timeout(1)
|
||||
// check that all things are in place
|
||||
for (const id in extractedData) {
|
||||
if (id === 'weather-icon') {
|
||||
@@ -634,6 +643,7 @@ When Los Angeles is selected the `showWeather` function should display the data
|
||||
// construct the object from the data from the API
|
||||
const extractedData = helper(body);
|
||||
|
||||
await timeout(1)
|
||||
// check that all things are in place
|
||||
for (const id in extractedData) {
|
||||
if (id === 'weather-icon') {
|
||||
|
||||
Reference in New Issue
Block a user