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

Exclusive suites,specs #524

Closed
wclr opened this issue Jul 27, 2012 · 31 comments
Closed

Exclusive suites,specs #524

wclr opened this issue Jul 27, 2012 · 31 comments

Comments

@wclr
Copy link

wclr commented Jul 27, 2012

There is the issue in Pivotal Jasmine repo that well describes the problem:
jasmine/jasmine#181 (comment)

what do you think is it worth to implement?

@tj
Copy link
Contributor

tj commented Jul 27, 2012

i dont get it, what is "iit" etc?

@domenic
Copy link
Contributor

domenic commented Jul 27, 2012

This is actually really useful. It's like the opposite of xit, it says "if I have iit-ed a given test, run it and no others". In other word it xits all other tests for you.

Yeah, grep works too, but sometimes iit is just a bit easier.

@tj
Copy link
Contributor

tj commented Jul 27, 2012

oh i see, nice feature, weird implementation haha "xit" is weird too though IMO

@paulmillr
Copy link
Contributor

sounds like crap for me. 👎

@Raynos
Copy link
Contributor

Raynos commented Jul 27, 2012

This is a very good feature.

The problem is that it's hard to name.

Being able to run individual describe or it blocks by editing the code rather then using --grep is useful

@tj
Copy link
Contributor

tj commented Jul 27, 2012

i dig it, i was sceptical about xit etc but the implementations are small which is more what matters to me. I dont want a ton of extra features if they add considerable weight, but I think we could easily translate these into --greps and reuse that logic

@tj
Copy link
Contributor

tj commented Jul 27, 2012

for example iit (with a better name? haha) could append @run to the title, and grep that, the rest just works

@Raynos
Copy link
Contributor

Raynos commented Jul 27, 2012

@visionmedia if you implement iit we also need ddescribe and ccontext

@Raynos
Copy link
Contributor

Raynos commented Jul 27, 2012

The better API might be

it(name, function, true)

where the optional last boolean turns it into an "only run this block"

@tj
Copy link
Contributor

tj commented Jul 27, 2012

yeah the first char thing is kinda silly, I like that it's super convenient, "xit" at least sort of reads like what it does. I dont like context though I want to remove that, it and describe are acceptable globals but not so much context

@tj
Copy link
Contributor

tj commented Jul 27, 2012

same with specify etc, those should be a different UI if anything

@Raynos
Copy link
Contributor

Raynos commented Jul 27, 2012

@visionmedia if you implement this either kill the context global or allow this pattern to work for all globals including test and suite and other interfaces

@tj
Copy link
Contributor

tj commented Jul 27, 2012

yeah this pattern would have to be for the others as well. The globals don't bother me though, xdescribe etc are completely irrelevant

@wclr
Copy link
Author

wclr commented Jul 28, 2012

Instead of xdescribe, ddescrbe, xit, iit maybe it would be better to use symbols at the beginning of the name of test, for example # for pending and @ for exclusive:

describe('#should be pending test and should not be run', ... )

and for exclusive tests use @ symbol at the beginneing of the name:

describe('@should be exclusive test to run', ... )

@Raynos
Copy link
Contributor

Raynos commented Jul 28, 2012

That breaks backwards compatibility

@wclr
Copy link
Author

wclr commented Jul 28, 2012

@Raynos You mean for someone who used that symbols at the beginning for the test names? Well, I think if this method is more convenient for a workflow difficulty with backwards compatibility could be overcome.

@tj
Copy link
Contributor

tj commented Jul 28, 2012

@whitecolor yeah I'd prefer something like that personally, it would automatically work for TDD etc too, and exports can't support this feature unless we use the titles +1 from me that's a good alternative, we can always deprecate "xit" and let that sit for a few releases

@tj
Copy link
Contributor

tj commented Jul 28, 2012

not sure about those chars though neither of them scream exclusive or pending to me

@wclr
Copy link
Author

wclr commented Jul 28, 2012

"!" - could be used for pending
"*" - for exclusive

or ("?" for pending and "!" for exclusive)

some symbols could be chosen as defaults but also made configurable via parameters and via mocha setup in browser.

@domenic
Copy link
Contributor

domenic commented Jul 28, 2012

Guys just copy ddescribe and iit and be done with it. Or at least do that as well. It's simple, intuitive, and compatible with other BDD interfaces.

@tj
Copy link
Contributor

tj commented Jul 28, 2012

I definitely wouldn't call it intuitive, I had no clue what it was from looking at it, chars wouldn't be any better though. only_describe( etc would be better IMO, 4 more chars I guess :p but at least it reads ok

@tj
Copy link
Contributor

tj commented Aug 14, 2012

definitely want this lately, anyone hate only_ as a prefix? iit just looks like a typo

@rauchg
Copy link
Contributor

rauchg commented Aug 14, 2012

I vote for some sort of title prefix, maybe !!

@wclr
Copy link
Author

wclr commented Aug 14, 2012

only_ seems to be too elablorated. But why not make two options for a developer: either use "only_" or shorter variant "o" (odescribe, oit to be consistent with xdescribe, xit syntax).

@tj
Copy link
Contributor

tj commented Aug 14, 2012

too elaborate? because it's clearer? I'm not a fan of xit either personally, I'd rather have ignore_it or similar, it reads better, more obvious at a glance, less easy to accidentally leave in your source

@rauchg
Copy link
Contributor

rauchg commented Aug 14, 2012

xit I didn't immediately get personally, and iit just put me in limbo

@wclr
Copy link
Author

wclr commented Aug 14, 2012

Personally I like only_ and ignore_ because its clear, right. But I think its good to have shortcuts (like "x" and "o" prefix) either. I vote for only_ and _ignore and "o" and "x" shortcuts.

@rauchg
Copy link
Contributor

rauchg commented Aug 14, 2012

I'm gonna lobby for it.skip( it.only( tomorrow

@domenic
Copy link
Contributor

domenic commented Aug 14, 2012

I like it.skip and it.only, but I would again encourage iit and ddescribe additionally, just for equivalence with existing libraries (JSTestDriver/Testacular/Angular.js's Jasmine fork, mainly).

I also really want a shorthand. Like xit and xdescribe, these will be things I quickly add and never commit to source control, so clarity is not important to me at all, but taking one keypress to insert definitely is. I want to add a single character, press Ctrl+S, and have the watch feature automatically run that test and that test only.

@tj
Copy link
Contributor

tj commented Aug 14, 2012

-1 on shortcuts for me, if you're using these that often you have bigger issues IMO, it doesn't need to be that convenient . I like your suggestion @guille, less globals, a little more annoying to jump a word and type .skip but haha that goes back to the who cares thing

@szkrd
Copy link

szkrd commented Nov 23, 2015

iit and ddescribe is a better way to catch these keywords with lint, so while you could develop locally and ignore lint errors, the ci build tool would catch them. Is this clear?

I also find it weird that xdescribe and xit was fine, but ddescribe and iit wasn't
#263

Would it be possible to reconsider this decision?

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

No branches or pull requests

7 participants