From 1bf4d5bf4860a82eaa23fcadef219c4e9d4bc991 Mon Sep 17 00:00:00 2001 From: Smokeball Date: Mon, 8 Mar 2021 15:10:37 +1100 Subject: [PATCH] Update readme --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 31a3bfa..abb45d0 100644 --- a/README.md +++ b/README.md @@ -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. -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 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. -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 * Only modify the `get-arnie-quotes.js` file. * 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. +* 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 -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. ## Docs