DEV Community

Alex Spinov
Alex Spinov

Posted on

Bun Test Has a Free API That Runs Jest-Compatible Tests 10x Faster

Bun's built-in test runner: zero config, Jest-compatible, 10x faster.

import { describe, it, expect, mock } from 'bun:test'

describe('math', () => {
  it('adds', () => expect(1 + 1).toBe(2))
})

const fn = mock(() => 42)
fn()
expect(fn).toHaveBeenCalled()
Enter fullscreen mode Exit fullscreen mode
bun test  # that's it
Enter fullscreen mode Exit fullscreen mode

Jest 8.5s vs Vitest 3.2s vs Bun 0.8s for 1000 tests.


Need to automate data collection or build custom scrapers? Check out my Apify actors for ready-made tools, or email spinov001@gmail.com for custom solutions.

Top comments (0)