Skip to content

Instantly share code, notes, and snippets.

@tolmasky
Created December 2, 2018 06:31
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 tolmasky/ba92f751a6549011f543cdf7d6ec7baf to your computer and use it in GitHub Desktop.
Save tolmasky/ba92f751a6549011f543cdf7d6ec7baf to your computer and use it in GitHub Desktop.

Endpoint

Export "endpoint"

plugin @lithograph/http-response
const page = await (await getBrowserContext())
    .open.and.login("default-user");

await page.goto.runkit.notebook.new();

await page.notebook.cell(0).type(
`module.exports.endpoint = (_, response) => response.end('OK!');`);
await page.notebook.wait.for.save();

const endpointURL = page.notebook.endpointURL();

expect(response.status).toBe(200);
expect(await response.text()).toBe("OK!");

plugin: @lithograph/http-response

key value
endpoint endpointURL
status 200
HEADERS
x-powered-by runkit.com
runkit-rate-limit-remaining PRESENT
BODY
text OK!
key value
endpoint endpointURL
status 200
HEADERS
x-powered-by runkit.com
runkit-rate-limit-remaining PRESENT
BODY
text OK!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment