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

[Feature request] Would it be possible to support the --listTests CLI flag? #328

Closed
benedfit opened this issue Jul 10, 2023 · 3 comments · Fixed by #521
Closed

[Feature request] Would it be possible to support the --listTests CLI flag? #328

benedfit opened this issue Jul 10, 2023 · 3 comments · Fixed by #521

Comments

@benedfit
Copy link

benedfit commented Jul 10, 2023

I'd like to be able to use the new "Re-run only failed tests" feature in CircleCI. This entails being able to run specs on an individual basis, is this something test-runner could provide?

Here's how I am achieving this with Jest:

yarn jest --listTests | circleci tests run --command="xargs yarn jest --ci --runInBand"

--listTests provides a space/new-line delimited list of specs to run, which are then piped to the second command, allowing certain tests to be run individually

@MH4GF
Copy link
Contributor

MH4GF commented Jul 18, 2023

@benedfit Can't you run with this? yarn test-storybook -- --listTests
ref: #230 (comment)

@benedfit
Copy link
Author

Unfortunately not, I get error: unknown option '--listTests'

@MH4GF
Copy link
Contributor

MH4GF commented Jul 18, 2023

oh, in my project, I am probably getting the expected results by doing the following(passing two --):

yarn test -- -- --listTests
yarn run v1.19.0
warning From Yarn 1.0 onwards, scripts don't require "--" for options to be forwarded. In a future version, any explicit "--" will be forwarded as-is to the scripts.
$ test-storybook --stories-json -- --listTests
/private/var/folders/xxx/yyy/components-foo.test.js
/private/var/folders/xxx/yyy/components-bar.test.js
...snip...

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 a pull request may close this issue.

2 participants