Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ Commands use `withErrorHandling()` HOF which:

## Testing Notes

- `bun run test` uses vitest; CI runs `bun test` (bun's native runner). They have different semantics — verify both locally before pushing.
- Tests use bun's native runner (`bun test`, imports from `bun:test`); `bun run test` is an alias. Keep a single runner so CI exercises the same suite, dependencies, and lockfile that local runs do.
- `pipe-truncation.test.ts` runs against `dist/cli.js`, so run `bun run build` before `bun test`.
- Bun's native test runner snapshots any `process.exitCode` mutation during a test and uses it as the suite's exit code, even when reverted. Tests that need to assert exit behavior must run the code in a child process.

## Date Handling
Expand Down
53 changes: 3 additions & 50 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"format": "bun run biome format --write src",
"format:check": "bun run biome format src",
"typecheck": "bun run tsc --noEmit",
"test": "bun run vitest run",
"test": "bun test",
"link": "bun run build && bun link",
"prepublishOnly": "bun run build"
},
Expand Down Expand Up @@ -58,7 +58,6 @@
"@types/bun": "latest",
"oxlint": "^1.38.0",
"tsup": "^8.0.0",
"typescript": "^5.7.2",
"vitest": "^5.0.0"
"typescript": "^5.7.2"
}
}
2 changes: 1 addition & 1 deletion src/lib/__tests__/display.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect } from 'vitest';
import { describe, it, expect } from 'bun:test';
import { formatEstimate, isTaskOverdue, formatTags, pluralize } from '../display.js';
import type { Task } from '../../types.js';

Expand Down
6 changes: 1 addition & 5 deletions src/lib/__tests__/errors.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect, beforeAll } from 'vitest';
import { describe, it, expect } from 'bun:test';
import { execFile } from 'child_process';
import { promisify } from 'util';
import { mkdtemp, writeFile, rm } from 'fs/promises';
Expand Down Expand Up @@ -74,10 +74,6 @@ handleError(error);
}

describe('handleError', () => {
beforeAll(() => {
// Sanity check the helper compiles cleanly; nothing else needed.
});

it('exits with code 1 instead of calling process.exit', async () => {
const { exitCode } = await runHandleError('error_plain');
expect(exitCode).toBe(1);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/__tests__/pipe-truncation.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect, beforeAll } from 'vitest';
import { describe, it, expect, beforeAll } from 'bun:test';
import { spawn, execFile } from 'child_process';
import { promisify } from 'util';
import { existsSync, readFileSync } from 'fs';
Expand Down
Loading