Skip to content
DocsGuidesReferenceBlog
Install
HomeDocsGuidesReferenceBlog
Install Bun v1.3.14
RuntimePackage ManagerBundlerTest RunnerGuidesReferenceBlogFeedback
Guides
  • Overview

    • Guides
  • Deployment

    • Deploy on Vercel
    • Deploy on Railway
    • Deploy on Render
    • Deploy on AWS Lambda
    • Deploy on DigitalOcean
    • Deploy on Google Cloud Run
  • Runtime & Debugging

    • TypeScript types
    • Re-map import paths
    • VS Code debugger
    • Web debugger
    • Heap snapshots
    • Build-time constants
    • Define constants
    • GitHub Actions
    • Codesign on macOS
  • Utilities

    • Upgrade Bun
    • Detect Bun
    • Get Bun version
    • Hash password
    • Generate UUID
    • Base64 encoding
    • Gzip compression
    • DEFLATE compression
    • Escape HTML
    • Deep equality
    • Sleep
    • File URL to path
    • Path to file URL
    • Find executable path
    • import.meta.dir
    • import.meta.file
    • import.meta.path
    • Check entrypoint
    • Get entrypoint path
  • Ecosystem & Frameworks

    • Astro with Bun
    • Discord.js with Bun
    • Docker with Bun
    • Drizzle with Bun
    • Gel with Bun
    • Elysia with Bun
    • Express with Bun
    • Hono with Bun
    • Mongoose with Bun
    • Neon Drizzle with Bun
    • Neon Serverless Postgres with Bun
    • Next.js with Bun
    • Nuxt with Bun
    • PM2 with Bun
    • Prisma ORM with Bun
    • Prisma Postgres with Bun
    • Qwik with Bun
    • React with Bun
    • Remix with Bun
    • TanStack Start with Bun
    • Sentry with Bun
    • SolidStart with Bun
    • SSR React with Bun
    • SvelteKit with Bun
    • systemd with Bun
    • Vite with Bun
    • Upstash with Bun
  • HTTP & Networking

    • HTTP Server with Bun
    • Simple HTTP Server with Bun
    • Fetch with Bun
    • Hot reload an HTTP server
    • Start a cluster of HTTP servers
    • Configure TLS
    • Proxy HTTP requests using fetch()
    • Stream file response
    • Upload files via HTTP using FormData
    • Fetch with unix domain sockets
    • Stream with iterators
    • Server-Sent Events
    • Stream with Node.js
  • WebSocket

    • Simple server
    • Pub-sub server
    • Contextual data
    • Enable compression
  • Processes & System

    • Spawn child process
    • Read stdout
    • Read stderr
    • Parse command-line arguments
    • Read from stdin
    • Spawn a child process and communicate using IPC
    • Listen for CTRL+C
    • OS signals
    • Process uptime
    • Run shell command
    • Set time zone
    • Set env variables
    • Read env variables
  • Package Manager

    • Add a dependency
    • Add a dev dependency
    • Add an optional dependency
    • Add a peer dependency
    • Add a Git dependency
    • Add a tarball dependency
    • Install with alias
    • Workspaces with Bun
    • Override the default npm registry
    • Configure a scoped registry
    • Azure Artifacts with Bun
    • JFrog Artifactory with Bun
    • Add a trusted dependency
    • Generate a yarn-compatible lockfile
    • Migrate from npm to bun
    • Configure git to diff Bun's lockfile
    • Install Bun in GitHub Actions
  • Test Runner

    • Run tests
    • Watch mode
    • Migrate from Jest
    • Mock functions
    • Spy on methods
    • Mock system time
    • Snapshot testing
    • Update snapshots
    • Coverage reports
    • Coverage threshold
    • Concurrent test glob
    • Skip tests
    • Todo tests
    • Test timeout
    • Bail early
    • Re-run tests
    • Testing Library
    • DOM tests
    • Test Svelte
  • Runtime & Debugging

    • VS Code debugger
    • Web debugger
    • Heap snapshots
    • Build-time constants
    • Define constants
    • GitHub Actions
    • Codesign on macOS
  • Module System

    • Import JSON
    • Import TOML
    • Import YAML
    • Import JSON5
    • Import XML
    • Import HTML
    • import.meta.dir
    • import.meta.file
    • import.meta.path
    • Check entrypoint
    • Get entrypoint path
  • File System

    • Read as string
    • Read to Buffer
    • Read to Uint8Array
    • Read to ArrayBuffer
    • Read JSON file
    • Get MIME type
    • Check file exists
    • Watch directory
    • Read as stream
    • Write string to file
    • Write Blob
    • Write Response
    • Append to file
    • Incremental write
    • Write stream
    • Write to stdout
    • Write file to stdout
    • Copy file
    • Delete file
    • Delete files
    • Delete directories
  • Utilities

    • Hash password
    • Generate UUID
    • Base64 encoding
    • Gzip compression
    • DEFLATE compression
    • Escape HTML
    • Deep equality
    • Sleep
    • File URL to path
    • Path to file URL
    • Find executable path
  • HTML Processing

    • Extract links using HTMLRewriter
    • OpenGraph tags
  • Binary Data

    • ArrayBuffer to string
    • ArrayBuffer to Buffer
    • ArrayBuffer to Blob
    • ArrayBuffer to Array
    • ArrayBuffer to Uint8Array
    • Buffer to string
    • Buffer to ArrayBuffer
    • Buffer to Blob
    • Buffer to Uint8Array
    • Buffer to ReadableStream
    • Blob to string
    • Blob to ArrayBuffer
    • Blob to Uint8Array
    • Blob to DataView
    • Blob to ReadableStream
    • Uint8Array to string
    • Uint8Array to ArrayBuffer
    • Uint8Array to Buffer
    • Uint8Array to Blob
    • Uint8Array to DataView
    • Uint8Array to ReadableStream
    • DataView to string
  • Streams

    • Stream to string
    • Stream to JSON
    • Stream to Blob
    • Stream to Buffer
    • Stream to ArrayBuffer
    • Stream to Uint8Array
    • Stream to array
    • Readable to string
    • Readable to JSON
    • Readable to Blob
    • Readable to Uint8Array
    • Readable to ArrayBuffer
  1. Guides
  2. ›Test Runner

Run tests in watch mode with Bun

Use the --watch flag to run your tests in watch mode.

terminal
bun test --watch

Watch mode restarts the running Bun process whenever a file changes. It's fast. In this example, the editor saves the file on every keystroke.

Running tests in watch mode in
Bun


See bun test.

PreviousRun your tests with the Bun test runnerNextMigrate from Jest to Bun's test runner
Edit this page on GitHubView as Markdown