diff --git a/curriculum/challenges/english/blocks/learn-fetch-and-promises-by-building-an-fcc-authors-page/641da803d9892447d059804e.md b/curriculum/challenges/english/blocks/learn-fetch-and-promises-by-building-an-fcc-authors-page/641da803d9892447d059804e.md index a053a16cee4..573ab9dbdb7 100644 --- a/curriculum/challenges/english/blocks/learn-fetch-and-promises-by-building-an-fcc-authors-page/641da803d9892447d059804e.md +++ b/curriculum/challenges/english/blocks/learn-fetch-and-promises-by-building-an-fcc-authors-page/641da803d9892447d059804e.md @@ -20,19 +20,7 @@ window.fetch = () => Promise.resolve({json: () => Promise.resolve([{ author: 'Wh You should create an `img` element. ```js -const retryingTest = (test, message, tries = 20) => { - if (tries < 1) return Promise.reject(message); - if (test()) return Promise.resolve(); - - return new Promise((resolve, reject) => { - setTimeout(() => { - retryingTest(test, message, tries - 1) - .then(resolve) - .catch(reject); - }, 1); - }); -}; -await retryingTest(() => document.querySelector('img'), "'img' element not found"); +__helpers.retryingTest(() => document.querySelector('img'), "'img' element not found"); ``` Your `img` element should have the class `"user-img"`. diff --git a/curriculum/challenges/english/blocks/learn-fetch-and-promises-by-building-an-fcc-authors-page/641da836581c254815f785fe.md b/curriculum/challenges/english/blocks/learn-fetch-and-promises-by-building-an-fcc-authors-page/641da836581c254815f785fe.md index 1cdc65c63c4..d981d909ebe 100644 --- a/curriculum/challenges/english/blocks/learn-fetch-and-promises-by-building-an-fcc-authors-page/641da836581c254815f785fe.md +++ b/curriculum/challenges/english/blocks/learn-fetch-and-promises-by-building-an-fcc-authors-page/641da836581c254815f785fe.md @@ -22,19 +22,7 @@ window.fetch = () => Promise.resolve({json: () => Promise.resolve([{ author: 'Wh You should create a `p` element. ```js -const retryingTest = (test, message, tries = 20) => { - if (tries < 1) return Promise.reject(message); - if (test()) return Promise.resolve(); - - return new Promise((resolve, reject) => { - setTimeout(() => { - retryingTest(test, message, tries - 1) - .then(resolve) - .catch(reject); - }, 1); - }); -}; -await retryingTest(() => document.querySelector('p'), "'p' element not found"); +__helpers.retryingTest(() => document.querySelector('p'), "'p' element not found"); ``` Your `p` element should have the class `"bio"` diff --git a/curriculum/challenges/english/blocks/learn-fetch-and-promises-by-building-an-fcc-authors-page/641da86294fd9f485d3c2bf0.md b/curriculum/challenges/english/blocks/learn-fetch-and-promises-by-building-an-fcc-authors-page/641da86294fd9f485d3c2bf0.md index 1700b16c7db..5bfa99b2e65 100644 --- a/curriculum/challenges/english/blocks/learn-fetch-and-promises-by-building-an-fcc-authors-page/641da86294fd9f485d3c2bf0.md +++ b/curriculum/challenges/english/blocks/learn-fetch-and-promises-by-building-an-fcc-authors-page/641da86294fd9f485d3c2bf0.md @@ -22,19 +22,7 @@ window.fetch = () => Promise.resolve({json: () => Promise.resolve([{ author: 'Wh You should create an anchor element. ```js -const retryingTest = (test, message, tries = 20) => { - if (tries < 1) return Promise.reject(message); - if (test()) return Promise.resolve(); - - return new Promise((resolve, reject) => { - setTimeout(() => { - retryingTest(test, message, tries - 1) - .then(resolve) - .catch(reject); - }, 1); - }); -}; -await retryingTest(() => document.querySelector('a'), "'a' element not found"); +__helpers.retryingTest(() => document.querySelector('a'), "'a' element not found"); ``` Your anchor element should have the class `"author-link"`. diff --git a/curriculum/challenges/english/blocks/learn-fetch-and-promises-by-building-an-fcc-authors-page/641daa8c2c3e364ac3650b37.md b/curriculum/challenges/english/blocks/learn-fetch-and-promises-by-building-an-fcc-authors-page/641daa8c2c3e364ac3650b37.md index 5074796b7e5..0ff03a61f91 100644 --- a/curriculum/challenges/english/blocks/learn-fetch-and-promises-by-building-an-fcc-authors-page/641daa8c2c3e364ac3650b37.md +++ b/curriculum/challenges/english/blocks/learn-fetch-and-promises-by-building-an-fcc-authors-page/641daa8c2c3e364ac3650b37.md @@ -22,19 +22,7 @@ window.fetch = () => Promise.resolve({json: () => Promise.resolve([{ author: 'Wh You should create a `div` element before your `p` element. ```js -const retryingTest = (test, message, tries = 20) => { - if (tries < 1) return Promise.reject(message); - if (test()) return Promise.resolve(); - - return new Promise((resolve, reject) => { - setTimeout(() => { - retryingTest(test, message, tries - 1) - .then(resolve) - .catch(reject); - }, 1); - }); -}; -await retryingTest(() => document.querySelector('p')?.previousElementSibling?.tagName === 'DIV', "'div' element not found"); +__helpers.retryingTest(() => document.querySelector('p')?.previousElementSibling?.tagName === 'DIV', "'div' element not found"); ``` Your `div` element should have the `class` set to `"purple-divider"`. diff --git a/curriculum/challenges/english/blocks/workshop-fcc-authors-page/641da803d9892447d059804e.md b/curriculum/challenges/english/blocks/workshop-fcc-authors-page/641da803d9892447d059804e.md index 43b26c5b481..eb7841a0174 100644 --- a/curriculum/challenges/english/blocks/workshop-fcc-authors-page/641da803d9892447d059804e.md +++ b/curriculum/challenges/english/blocks/workshop-fcc-authors-page/641da803d9892447d059804e.md @@ -22,19 +22,7 @@ window.fetch = () => Promise.resolve({json: () => Promise.resolve([{ author: 'Wh You should create an `img` element. ```js -const retryingTest = (test, message, tries = 20) => { - if (tries < 1) return Promise.reject(message); - if (test()) return Promise.resolve(); - - return new Promise((resolve, reject) => { - setTimeout(() => { - retryingTest(test, message, tries - 1) - .then(resolve) - .catch(reject); - }, 1); - }); -}; -await retryingTest(() => document.querySelector('img'), "'img' element not found"); +__helpers.retryingTest(() => document.querySelector('img'), "'img' element not found"); ``` Your `img` element should have the class `"user-img"`. diff --git a/curriculum/challenges/english/blocks/workshop-fcc-authors-page/641da836581c254815f785fe.md b/curriculum/challenges/english/blocks/workshop-fcc-authors-page/641da836581c254815f785fe.md index 1b43d589edb..f082a341115 100644 --- a/curriculum/challenges/english/blocks/workshop-fcc-authors-page/641da836581c254815f785fe.md +++ b/curriculum/challenges/english/blocks/workshop-fcc-authors-page/641da836581c254815f785fe.md @@ -22,19 +22,7 @@ window.fetch = () => Promise.resolve({json: () => Promise.resolve([{ author: 'Wh You should create a `p` element. ```js -const retryingTest = (test, message, tries = 20) => { - if (tries < 1) return Promise.reject(message); - if (test()) return Promise.resolve(); - - return new Promise((resolve, reject) => { - setTimeout(() => { - retryingTest(test, message, tries - 1) - .then(resolve) - .catch(reject); - }, 1); - }); -}; -await retryingTest(() => document.querySelector('p'), "'p' element not found"); +__helpers.retryingTest(() => document.querySelector('p'), "'p' element not found"); ``` Your `p` element should have the class `"bio"` diff --git a/curriculum/challenges/english/blocks/workshop-fcc-authors-page/641da86294fd9f485d3c2bf0.md b/curriculum/challenges/english/blocks/workshop-fcc-authors-page/641da86294fd9f485d3c2bf0.md index 57226cf21a2..0bace46eaba 100644 --- a/curriculum/challenges/english/blocks/workshop-fcc-authors-page/641da86294fd9f485d3c2bf0.md +++ b/curriculum/challenges/english/blocks/workshop-fcc-authors-page/641da86294fd9f485d3c2bf0.md @@ -22,19 +22,7 @@ window.fetch = () => Promise.resolve({json: () => Promise.resolve([{ author: 'Wh You should create an anchor element. ```js -const retryingTest = (test, message, tries = 20) => { - if (tries < 1) return Promise.reject(message); - if (test()) return Promise.resolve(); - - return new Promise((resolve, reject) => { - setTimeout(() => { - retryingTest(test, message, tries - 1) - .then(resolve) - .catch(reject); - }, 1); - }); -}; -await retryingTest(() => document.querySelector('a'), "'a' element not found"); +__helpers.retryingTest(() => document.querySelector('a'), "'a' element not found"); ``` Your anchor element should have the class `"author-link"`. diff --git a/curriculum/challenges/english/blocks/workshop-fcc-authors-page/641daa8c2c3e364ac3650b37.md b/curriculum/challenges/english/blocks/workshop-fcc-authors-page/641daa8c2c3e364ac3650b37.md index e062e17421b..4c843b6726a 100644 --- a/curriculum/challenges/english/blocks/workshop-fcc-authors-page/641daa8c2c3e364ac3650b37.md +++ b/curriculum/challenges/english/blocks/workshop-fcc-authors-page/641daa8c2c3e364ac3650b37.md @@ -22,19 +22,7 @@ window.fetch = () => Promise.resolve({json: () => Promise.resolve([{ author: 'Wh You should create a `div` element before your `p` element. ```js -const retryingTest = (test, message, tries = 20) => { - if (tries < 1) return Promise.reject(message); - if (test()) return Promise.resolve(); - - return new Promise((resolve, reject) => { - setTimeout(() => { - retryingTest(test, message, tries - 1) - .then(resolve) - .catch(reject); - }, 1); - }); -}; -await retryingTest(() => document.querySelector('p')?.previousElementSibling?.tagName === 'DIV', "'div' element not found"); +__helpers.retryingTest(() => document.querySelector('p')?.previousElementSibling?.tagName === 'DIV', "'div' element not found"); ``` Your `div` element should have the `class` set to `"purple-divider"`.