-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
ddescribe and iit do not work #296
Comments
I think you're looking for |
Yes, I tried these too. No effect. Probably broken? Beware that I am running the tests through gulp-jest ... |
Hmm, it works for me on master...what version are you using? describe('suite', function() {
it.only('a', function() { console.log('a'); });
it('b', function() { console.log('b'); });
}); (I only see 'a' printed with the above test) |
Yes, that's what I am after and is not working here. gulp-jest is using jest-cli version 0.4.0, see Can you try the above example of yours within gulp-jest? |
My 2 cents: afaics PS: the repo looks quite dead (over 2 years ago) https://github.com/davemo/jasmine-only |
Given that test files run in parallel, I don't think it'd be possible to know to skip other test files until it's too late. What you can do (and what I do often) is specify a unique part of the name of a test file as the first arg to the test runner. This will enure only tests matching that arg string get executed (and then internally, only the .only() test will run) |
The classic workaround ;) |
PS: the new jasmine syntax to run specific specs is to "focus" them with Not sure if it's possible to integrate it in |
@jeffmo sure, we all could do your classic workaround but let's think of DX and try to make our lives easier. I'd welcome a |
@binarykitchen: I don't think fit or fdescribe solve the problem here...and I don't see a solution, do you? How do you deal with the fact that tests run in parallel and therefore you can't know until you've already run all the tests whether one of them is marked as "focused" or "only"? |
good point @jeffmo i am sure this problem has already been solved somewhere else with other unit test runners such as mocha. load and parse all files first and then decide which tests to run. |
The karma runner for jasmine supports that. I don't know how it works exactly and how it differs from jest, still I think it's worth mentioning... |
Any updates on supporting fit & fdescribe in jest? |
Given that jest runs tests in parallel this seems quite impossible as @jeffmo pointed out earlier. What I've found to work well is
|
+1 |
@danielstern you can now use |
For Node.js testing, just moved over to try |
@arcseldon what has disappointed you about Jest? Can you elaborate on that? It's crucial to get such feedback, so we can work on this to make Jest better. |
@arcseldon this is a very vague comment on a random issue and isn't very helpful. If you have concerns or concrete issues and would like to see Jest improved, please help us by starting discussions in the appropriate places or send us pull requests to make Jest work for you. |
I think it is possible. |
Here's a workaround I'm using, in package.json:
then
|
FWIW ava has an issue for |
So, the main problem here is parallel execution, right? |
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. |
Somehow I cannot pick one test only anymore. Jest always scans for all tests and runs them all. Adding one
ddescribe()
in one of them has no impact.The text was updated successfully, but these errors were encountered: