I have a feature request; I'm using globs to load a large source tree before executing all my Jasmine specs. There doesn't currently appear to be a way to exclude particular files or directories from being loaded into the test page.
For example, imagine a config file as below
I need this as the source tree is not entirely under my control, shared amongst many collaborators, so there are occasionally files or directories that must be temporarily excluded from being loaded into the test page (as they interfere with other tests).
Moreover, there are too many subdirectories for me to remove the single-line glob and whitelist valid directories individually under src_files.
If this isn't something that is already planned or being worked on, then I'll implement it and submit a pull request.
I'd like to call it src_files_exclude to be more unambiguous, but I am fine with this. A pull request would be very appreciated.
It's a bit more complicated than I'd originally thought it would be - reconciling two lists of globbed expressions, keeping asynchronicity - but I'll try to do something over the coming week. I thought to add it as early as possible, in config.js when the configuration params are first accessed, if that sounds reasonable.
Anything I could do to help? I'm looking for exactly this type of functionality, only in my case because I need to exclude a test-dir and srv-dir which contain node-files, while the rest of the app is front-facing (I know, I could also create separate projects....)
Yeah, I could use all the help I can get! This would involve using the minimatch library for exclusion matching after globbing the files. Ask if you have any questions here, on the mailing list or email me personally.
I've implemented this in a fork (https://github.com/redking/testem/) but I haven't issued a pull request for two reasons
However, if airportyh is happy to accept this (limited) change, once the tests are finished I'll send a pull request.
Incidentally, the recent commit history of the fork is a little messy, due to my having committed webstorm artifacts, but the primary modification was a simple change to lib/config.js, using the "fileset" module
Sorry for the delay. I'll take a look at this tomorrow and hopefully get this in.
Added ability to ignore src files or serve files via src_files_ignore…
… and serve_files_ignore (#149).
Update files watched too for #149.
You can now use either src_files_ignore or serve_files_ignore. Please test!
I did a test and, since upgrading, my tests fail as the import order of dependencies in the src_files array is no longer respected! In fact, it appears it occurs since v0.2.58. I'll open a bug.
I know before you mentioned creating a custom runner to enforce the load order, but I would no longer benefit from wildcards and ** notation and would have to harcode the (large) list of source files under test, if that's correct ?