@ -23,25 +23,27 @@ The unit tests in `./src/get-arnie-quotes.test.js` will provide pre-defined URLs
The goal is to write an implementation of `getArnieQuotes()` that passes all unit tests.
The goal is to write an implementation of `getArnieQuotes()` that passes all unit tests.
To pass the unit tests, `getArnieQuotes()` must perform the following each URL passed in;
To pass the unit tests, `getArnieQuotes()` must perform the following on each passed URL
1. Perform a HTTP GET on the URL
1. Perform a HTTP GET on the URL
2. If the HTTP status code of the response is 200, push an object to the results array with a single key `"Arnie Quote"` and the HTTP response body's `message` property as the key's associated value.
2. If the HTTP status code of the response is 200, push an object to the results array with a single key `"Arnie Quote"` and the HTTP response body's `message` property as the key's associated value.
3. If the HTTP status code of the response is not 200, push an object to the results array with a single key `"FAILURE"` and the HTTP response body's `message` property as the key's associated value.
3. If the HTTP status code of the response is not 200, push an object to the results array with a single key `"FAILURE"` and the HTTP response body's `message` property as the key's associated value.
Finally, the `getArnieQuotes()` function must return the overall results array.
Finally, the `getArnieQuotes()` function must return a promise that resolves to the overall results array.
Note that in this challenge, the HTTP calls are mocked. You *must* use the provided `httpGet` function to perform your HTTP requests.
Note that for this challenge, the HTTP calls are mocked. You *must* use the provided `httpGet` function to perform your HTTP requests.
## Tips
## Tips
* Only modify the `get-arnie-quotes.js` file.
* Only modify the `get-arnie-quotes.js` file.
* You may introduce additional internal functions in `get-arnie-quotes.js`
* You may introduce additional internal functions in `get-arnie-quotes.js`
* Exploring all of the code files may provide useful hints.
* Exploring all of the code files may provide you with useful hints.
* We are most impressed with readable code that works.
* We are most impressed with readable code that works.
* Keep your solution as simple as possible, input validation for `get-arnie-quotes()` is not required.
* Code as if your `get-arnie-quotes()` function may one day be used against a real http implementation.
## Submission
## Submission
Once all unit tests pass, push your code upstream then send us the link to the github repo with your solution.
Once all unit tests pass, push your code upstream then send us the link to your github repo with your solution. Please do not create a pull request against the source repository.