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

[Bug]: Unable to run multiple tests through -t argument #15133

Closed
invertednz opened this issue Jun 18, 2024 · 5 comments
Closed

[Bug]: Unable to run multiple tests through -t argument #15133

invertednz opened this issue Jun 18, 2024 · 5 comments

Comments

@invertednz
Copy link

Version

29.7

Steps to reproduce

I'm trying to run a set of tests using jest

Create a basic test suite with 2 tests. Run the tests with flag: -t=Test1|Test2 or -t=^Test1$|^Test2$

Expected behavior

Both tests are run

Actual behavior

Neither tests are run

Additional context

-t=Test1 works by itself as does -t=Test2

Environment

System:
    OS: macOS 14.2
    CPU: (8) arm64 Apple M2
  Binaries:
    Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node
    npm: 10.1.0 - ~/.nvm/versions/node/v20.9.0/bin/npm
    pnpm: 9.1.1 - ~/.nvm/versions/node/v20.9.0/bin/pnpm
  npmPackages:
    jest: ^29.7.0 => 29.7.0
@mrazauskas
Copy link
Contributor

Try adding --showConfig flag to your commands to see if -t got interpreted as expected. It might be that you have to escape special characters (like|), because these can be pickup up bash (or any other shell).

@invertednz
Copy link
Author

invertednz commented Jun 24, 2024

Whether I use = or not I get the following @mrazauskas

'Test1|Test2' is not recognized as an internal or external command.

@mrazauskas
Copy link
Contributor

If I pass following commands to zsh on macOS:

  • jest -t throws|overrides shows an error: "zsh: command not found: overrides"
  • jest -t "throws|overrides" works as expected and after running tests prints: "Ran all test suites with tests matching "throws|overrides"."

@invertednz
Copy link
Author

Looks like it is related to another issue in the CI potentially. I don't want to leave this open if it is not a real issue

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants