Skip to content

Instantly share code, notes, and snippets.

@sergueyarellano
Created May 26, 2021 18:31
Show Gist options
  • Save sergueyarellano/4d5debba9b19b143a45c26da6fb70926 to your computer and use it in GitHub Desktop.
Save sergueyarellano/4d5debba9b19b143a45c26da6fb70926 to your computer and use it in GitHub Desktop.
// ...
test('composeRequest() should compose request options so they can be consumed by the GOT http customer module ', async function ({ deepEqual, end }) {
const config = {
endpoint: 'foo',
host: 'http://localhost:3333',
method: 'GET',
headers: { 'content-type': 'application/json' }
}
// composeRequest :: Payload -> Payload
const actual = composeRequest(lift(config))
const expected = {
event: { body: {} },
data: {
config,
request: {
uri: new URL('foo', 'http://localhost:3333'),
options: {
method: 'GET',
headers: { 'content-type': 'application/json' }
}
}
},
result: {}
}
deepEqual(actual, expected)
end()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment