Skip to content

Initial commit blocked: bun test error when boilerplate has no tests #672

@damien-schneider

Description

@damien-schneider

Summary

On a fresh new repository started with better-t-stack, the first commit is blocked by a pre-commit hook that runs bun test. The boilerplate doesn't include any test files yet, so Bun exits with an error, which slows down the initial setup.

With a setup with husky pre-commit & bun

Proposed fix

  • Add a minimal passing test (e.g., demo.test.ts) to the repo (or each app) so bun test succeeds by default:
    import { expect, it } from "bun:test";
    
    it("true is true", () => {
      expect(true).toBe(true);
    });
  • Include Bun type definitions by default:
    "bun-types": "^1.1.19"

This ensures pre-commit hooks pass on first commit and reduces friction for new contributors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions