(apiLink)
| 3 | */ |
| 4 | |
| 5 | const getData = (apiLink) => { |
| 6 | return new Promise((resolve, reject) => { |
| 7 | let myRequest = new XMLHttpRequest(); |
| 8 | myRequest.onload = function () { |
| 9 | if (this.readyState === 4 && this.status === 200) { |
| 10 | resolve(JSON.parse(this.responseText)); |
| 11 | } else { |
| 12 | reject(Error("No Data Found")); |
| 13 | } |
| 14 | }; |
| 15 | |
| 16 | myRequest.open("GET", apiLink); |
| 17 | myRequest.send(); |
| 18 | }); |
| 19 | }; |
| 20 | |
| 21 | getData("https://api.github.com/users/elzerowebschool/repos") |
| 22 | .then((result) => { |
no outgoing calls
no test coverage detected