-
Notifications
You must be signed in to change notification settings - Fork 79
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/skip it #82
base: master
Are you sure you want to change the base?
Feature/skip it #82
Conversation
Currently Goblin supports Xit() to skip It() tests. This adds a different syntax to achieve the same functionality.
IDK about this feature? What's the reason reason to change the api and make it more Mocha similar? I'm just wondering if it really makes sense to introduce a new API at this point. I believe I'd like more opinions about this. @xetorthio @matipan ? |
I was thinking of adding an The main rationale is to have a consistent interface to skip tests for
|
Hmm.. interesting. I like the concept but I'm not sure how useful that is.
|
I definitely used it.only() when I used to work with Node, but I doubt we will find too many cases of it.only() on github being used in production code since it's something you use while testing, and once the test passes, you change https://github.com/search?l=JavaScript&p=5&q=%22it.only%22&type=Code I do not know about the most popular testing frameworks from other languages, but in JS the .only pattern seems popular: https://github.com/search?l=JavaScript&p=5&q=%22it.only%22&type=Code |
I see.. and what would be the difference to use it.only() vs -goblin.run in this case? The fact that it's "easier" to set different |
I would say the biggest difference is not having to rely on regex to run any given test, or group of tests, while you are working on a separate piece of functionality. The only functional difference here is being able to test multiple sets of tests within a describe block without having to change the regex to include every With regex With Only
|
I don't think we're getting a review @marcosnils |
Sorry for the delay. Just had time to check this today. If I get it right this PR as it is right now doesn't fix anything or add any new feature. It only add a different way of skipping Now... skipping So I think that we should keep this PR open and work on adding one of those features and merge it then. And eventually, in a future major release, consider deprecating |
SGTM! Let's add those features also and 🚢 |
Awesome, thanks @xetorthio |
Goblin is inspired by Mocha, and Mocha has a set of functions that allows you to skip tests.
Goblin supports skipping with Xit().
Mocha allows you to invoke tests with a
skip()
function:Since Go does not allow us to have a struct and a function with the same name we cannot have
Alternatively, and as a way to set up skipping Describe blocks in a future PR, we can follow this pattern:
Xit() functionality is working as is for backwards compatibility.