Agent Skills: Initialize Bun Test

Set up bun test in a project (with Effect support if applicable)

UncategorizedID: michaelvessia/nixos-config/init-bun-test

Install this agent skill to your local

pnpm dlx add-skill https://github.com/MichaelVessia/nixos-config/tree/HEAD/modules/programs/agents/shared/_archive/init-bun-test

Skill Files

Browse the full folder contents for init-bun-test.

Download Skill

Loading file tree…

modules/programs/agents/shared/_archive/init-bun-test/SKILL.md

Skill Metadata

Name
init-bun-test
Description
Set up bun test in a project (with Effect support if applicable)

Initialize Bun Test

Set up bun test for this project.

Steps

  1. Detect if Effect project:

    • Check package.json for effect dependency
  2. Create bunfig.toml:

    Standard project:

    [test]
    root = "./src"
    testMatch = ["**/*.test.ts"]
    

    Effect project:

    [test]
    root = "./src"
    testMatch = ["**/*.test.ts"]
    
  3. Install test dependencies:

    Standard project:

    bun add -D @types/bun
    

    Effect project:

    bun add -D @types/bun @codeforbreakfast/bun-test-effect
    
  4. Add scripts to package.json:

    "test": "bun test",
    "test:watch": "bun test --watch"
    
  5. Create example test file (if no tests exist):

    Standard (src/example.test.ts):

    import { describe, expect, it } from 'bun:test'
    
    describe('example', () => {
      it('works', () => {
        expect(1 + 1).toBe(2)
      })
    })
    

    Effect (src/example.test.ts):

    import { describe, expect, it } from '@codeforbreakfast/bun-test-effect'
    import { Effect } from 'effect'
    
    describe('example', () => {
      it('works', () => {
        expect(1 + 1).toBe(2)
      })
    
      it.effect('works with Effect', () =>
        Effect.gen(function* () {
          const result = yield* Effect.succeed(42)
          expect(result).toBe(42)
        })
      )
    })
    
  6. Run tests to verify setup:

    bun test
    

Ask before creating example test file if tests already exist.