Skip to content

Support test("name", {options}, () => {}) in addition to test("name", () => {}, {options}) #21531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

pfgithub
Copy link
Contributor

@pfgithub pfgithub commented Aug 1, 2025

For vitest compatibility

Claude Bot and others added 7 commits August 1, 2025 02:50
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 <[email protected]>
@robobun
Copy link
Collaborator

robobun commented Aug 1, 2025

Updated 9:20 PM PT - Jul 31st, 2025

@autofix-ci[bot], your commit 0d49f2b has 9 failures in Build #21934:


🧪   To try this PR locally:

bunx bun-pr 21531

That installs a local version of the PR into your bun-21531 executable, so you can run:

bun-21531 --bun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants