Created
May 28, 2021 18:33
-
-
Save sergueyarellano/1baa32ca0ce5678b8931cef532e50d46 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defineStep('I make a {string} request to {string}', async function (method, endpoint) { | |
const headers = this.headers | |
const uri = new URL(endpoint, process.env.HOST) | |
const options = { headers, method } | |
this.response = await got(uri, options) | |
this.response.body = JSON.parse(get(this.response, 'body', '{}')) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment