jest: ddescribe and iit do not work
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.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 24 (14 by maintainers)
I think it is possible.
avaalso runs tests in parallel and itstest.only()is working as expected (only those tests are ran across all test files)I think you’re looking for
it.only()anddescribe.only()?So, the main problem here is parallel execution, right? What about –runInBand then? Can we fix the problem at least for non-parallel
runInBandmode?For Node.js testing, just moved over to try
Jestas opposed to my former go-to test dependencies (Mocha, Chai, Proxyquire and Sinon) - the idea of consolidating to just having to use Jest was a primary motiviation, together with Mock by default behaviour… really liked the idea of cutting down on the test harness plumbing. So far the experience using Jest has been really disappointing for reasons (one of many) such as this - too many workarounds and sub-optimal hacks to get equivalent behaviour that is expected to be out of the box. In fact, usingJesthas resulted in more plumbing, not less - and less options / power. UsingMocha, Chai, Proxyquire and Sinonis not ideal either (hence theJesttrial). Shame that a lot of the promise forJesthas not (yet) been realised - frustratingly close to what I was looking for - shall take another look in 6-12 months as I still think the library may one day get there.@danielstern you can now use
-i -t <pattern>I guess.My 2 cents: afaics
it.onlyworks, but in the relateddescribeblock (meaning if you have many test files they still run). What I would expect instead is that from all the test files, only the one marked asit.onlyis run.PS: the repo looks quite dead (over 2 years ago) https://github.com/davemo/jasmine-only