(method, route, base_url)
| 16 | const got = require('got'); |
| 17 | |
| 18 | const request = (method, route, base_url) => { |
| 19 | const {ID_TOKEN} = process.env; |
| 20 | if (!ID_TOKEN) { |
| 21 | throw Error('"ID_TOKEN" environment variable is required.'); |
| 22 | } |
| 23 | |
| 24 | return got(new URL(route, base_url.trim()), { |
| 25 | headers: { |
| 26 | Authorization: `Bearer ${ID_TOKEN.trim()}`, |
| 27 | }, |
| 28 | method: method || 'get', |
| 29 | throwHttpErrors: false, |
| 30 | }); |
| 31 | }; |
| 32 | |
| 33 | describe('End-to-End Tests', () => { |
| 34 | const {BASE_URL} = process.env; |
no outgoing calls
no test coverage detected