Skip to content

Instantly share code, notes, and snippets.

@sergueyarellano
Created May 28, 2021 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sergueyarellano/1baa32ca0ce5678b8931cef532e50d46 to your computer and use it in GitHub Desktop.
Save sergueyarellano/1baa32ca0ce5678b8931cef532e50d46 to your computer and use it in GitHub Desktop.
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