Skip to content

Files

basic

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jul 13, 2023
Jan 8, 2024
Aug 14, 2023
Feb 24, 2023
Dec 1, 2024
Nov 6, 2024
Feb 21, 2023
Dec 1, 2024
Jan 17, 2024
Aug 14, 2023
Aug 14, 2023
Aug 14, 2023
Aug 14, 2023
Nov 13, 2022
Aug 8, 2023
Aug 8, 2023
Nov 6, 2024
Jun 22, 2022
Jan 3, 2024
Dec 1, 2024
Dec 1, 2024
Feb 24, 2023
Aug 14, 2023
Aug 14, 2023
Aug 14, 2023
Mar 1, 2023
Dec 1, 2024
Jan 8, 2024
Nov 13, 2022
Jun 22, 2022
Jun 22, 2022
Aug 14, 2023
Nov 6, 2024
Mar 1, 2023
Aug 14, 2023
Dec 1, 2024
Nov 30, 2024
Nov 2, 2024
Jul 13, 2023
Jan 8, 2024

Hattip Basic Integration Tests

Running

When the environment variable CI equals true, pnpm run ci will all the automatic tests. When the environment variable CI does not equal true, pnpm run ci will run its tests on an already running server. You can set the server address by setting the environment variable TEST_HOST which defaults to http://127.0.0.1:3000.

To manually test streaming, run curl -ND - 'http://127.0.0.1:3000/bin-stream?delay=50' and observe the typewriter effect.

Manual Tests

All environments that provide a local development server are tested automatically. But testing actual deployments is also desirable. Follow the instructions below to test deployments.

Cloudflare Workers

Publish with wrangler publish.

Vercel Serverless Functions

Build locally with pnpm build:vercel and deploy with vercel deploy --prebuilt.

Not supported:

  • Custom status text
  • Request cancelation

Vercel Edge Functions

Build locally with pnpm build:vercel-edge and deploy with vercel deploy --prebuilt.

Not supported:

  • Custom status text
  • Request cancelation
  • Content-Length in simple text response

Netlify Functions (live)

Build locally with pnpm build:netlify-functions, deploy with netlify deploy.

Not supported:

  • Always uses chunked encoding when without compression
  • Streaming responses
  • Custom status text
  • Request cancelation

Netlify Edge Functions (live)

Build locally with pnpm build:netlify-edge, deploy with netlify deploy.

Not supported:

  • Always uses chunked encoding when without compression
  • Custom status text

Deno Deploy

Build with pnpm build:deno, cd into dist/deno and deploy with deployctl deploy --token <TOKEN> --project=<PROJECT> index.js.

Not supported:

  • Custom status text

AWS Lambda

Change InvokeMode to whatever you want and deploy with node aws-deploy.js deploy. Destroy with node aws-deploy.js destroy.

Not supported:

  • Streaming responses only supported with @hattip/adapter-aws-lambda/streaming
  • Always uses chunked encoding when without compression
  • Custom status text
  • Request cancelation