Files
bun.sh/simple.test.js
Claude Bot 422e47961b Add support for test() options as second parameter
Allows using test() with options as the second parameter:
- test("name", { timeout: 1000 }, () => { ... })
- test("name", 500, () => { ... })

While maintaining backward compatibility with the original syntax:
- test("name", () => { ... }, { timeout: 1000 })
- test("name", () => { ... }, 500)

This feature improves consistency with other testing frameworks
and provides a more intuitive parameter order.

Changes:
- Updated argument parsing in jest.zig createScope function
- Added TypeScript type overloads for test, test.only, test.skip, test.todo
- Added regression tests to ensure both syntaxes work
- Updated type tests to verify TypeScript compatibility

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-01 02:50:08 +00:00

8 lines
255 B
JavaScript

// Test just the original syntax first to make sure it works
import { test, expect } from "bun:test";
test("original syntax still works", () => {
expect(true).toBe(true);
}, { timeout: 1000 });
console.log("Original syntax test defined successfully");