-
Notifications
You must be signed in to change notification settings - Fork 145
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
Exclude directories? #128
Comments
I'm not totally sure what you're looking to exclude here. Do you want to not supply the |
I want to be able to say, “Run all the files in my entire repo ending with Spec.js EXCEPT files in node_modules”. There is not a way to express this because the current options allow for white-listing but not black-listing. Every time I add a new folder in my root directory, I have to add it to the white-listing.
Ironically, I could just let it run the few Spec.js files in node_modules, too (who cares?) except the ones that come built with Jasmine actually fail…
… On Feb 26, 2018, at 2:50 PM, Gregg Van Hove ***@***.***> wrote:
I'm not totally sure what you're looking to exclude here. Do you want to not supply the spec_files key in your jasmine.json? Or do you want to add a large glob and then another rule to remove things from that glob?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#128 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AMQpjMkG8agDK-QuRDFMtGe72nKeMpgVks5tYwrtgaJpZM4SLTWt>.
|
Ok, that makes sense. We would be happy to review a pull request that changes the behavior of the file loading code to allow a glob starting with {
spec_files: [
'**/*spec.js',
'!foo/**/*.js',
'foo/really/*.js'
]
} Would include all the files under |
I'm trying to use the command line to filtering specs but with no luck. I want to call jasmine from cmd line but I tried and tried to use --filter and seems it accept regex and not a glob. Will try to investigate and make a PR for this. Is pretty common wanting to filter specs from CLI, for example from project's package.json "test" . Do you known if I can filter using globs ? thanks |
@cancerberoSgx The Hope this helps. Thanks for using Jasmine! |
OK now I got it , by looking at the code... I just created this one #131 to add a small comment about filtering because at least for me was not clear and hard to find this info that IMO is important. Thanks and keep the good work! |
#131 is merged. We would still be happy to review a pull request to allow |
In general what I've seen for supporting this, is having two properties, "include" and "exclude". Current "spec_files" would be "include" and any file that matches any of the globs will be included. Then if any of the "exclude" glob matches the file it won't be included, not matter if it matches the "include" one. I've seen this in typescript tsconfig.json, vscode settings and others If you don't want to define another property in jasmine.json, then the only way I see is doing kind of "Magic" and treat specially those globs that starts with "!". Won't be an OR anymore... Personally I don't like that - I would introduce another property like "spec_files_exclude". My two cents |
I don't have a problem with an exclude only filter. The advantage of the The other advantage of the Neither of these arguments are super strong though, so I would also be happy to see a pull request that added an |
What is current state of this issue? Would like to help if still not done. In my opinion the
|
To my knowledge no work has been started for this issue. I still don't have a strong preference on which mechanism is used to allow exclusion of files/folders, so if you want to take a look at this, you're welcome to use either approach. |
Paths in spec_files and helpers starting with ! will be excluded from respectively spec files and helper files. jasmine#128
Paths in spec_files and helpers starting with ! will be excluded from respectively spec files and helper files. jasmine#128
Paths in spec_files and helpers starting with ! will be excluded from respectively spec files and helper files. jasmine#128
Is there any way to exclude directories in the configuration?
E.g. spec_files:
Sorry I can't find this anywhere else!
Thank you!
The text was updated successfully, but these errors were encountered: