Skip to content
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

Detect and swap test runner jest, node:test, & bun:test #21132

Open
1 task done
versecafe opened this issue Nov 24, 2024 · 3 comments
Open
1 task done

Detect and swap test runner jest, node:test, & bun:test #21132

versecafe opened this issue Nov 24, 2024 · 3 comments
Labels

Comments

@versecafe
Copy link
Contributor

Check for existing issues

  • Completed

Describe the feature

The test button next to tests while very helpful in JS/TS always uses jest in the command leading to it breaking if using the node, bun, or vitest test runners , with jest being the legacy option and with there being multiple options either detection and swapping of runners or a config based test command syntax would make the feature useable in modern TS codebases

Environment

.

If applicable, add mockups / screenshots to help present your vision of the feature

.

@osiewicz
Copy link
Contributor

We're sorta capable of doing this already with toolchains and extra task variables in config. We could try to detect test runner or fall back to an explicit choice made by user. One caveat with it is that toolchain detection currently works at worktree granularity, which would make e.g. detecting different test runners for different subdirectories of a worktree a bit tricky.

@mheidinger
Copy link

Something that also could be added with such a detection could be locating the right config file for a given test. E.g. if a test is executed in a sub-package of a mono-repo, the tooling may need the correct config file of the sub-package provided.

This is something that the VS Code Jest Runner extension is already doing today (and I replicated in Bash to make the test runner work in Zed w/ a custom task).

@JosephTLyons JosephTLyons added tasks and removed triage labels Dec 12, 2024
@dlindenkreuz
Copy link

Is this a duplicate of #12828?

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

No branches or pull requests

5 participants