-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Ability to add files and preprocessors programmatically #571
Comments
Why using globs does not work for you ?
|
globs are not flexible enough in some cases. Like the case that is described above, I would want to use */.test.js then iterate through the results and for each file also include a file with the same name, but without "test" suffix. As far as I know, it's not possible to do with just globs. |
Since the config is just JS could you calculate your own list of test files within your config and just pass that? I know that might not be ideal in your dev env (where you may be adding/removing files) but on a CI server presumably that wouldn't be an issue. |
Do you mean something like that?
|
Something like that! I also believe the files config array may include objects rather than strings for finer grain control over what is served and watched. Although, that may only be available in canary. |
Ah. Thank you very much. I didn't think of that myself. |
I'm setting up Karma to run on CI server for unit testing. I don't really want to specify each file that needs to be included, all of my JavaScript files are located under the same root folder, and if a file has a unit test the unittest file will have the same name as the original file + .test.js extension. It would be nice if I could provide a function that would be able to pick up all the .test.js files, and then get corresponding .js files added to the Karma configuration. Also, would be nice if the same patter would be applied to preprocessors... Right now, I don't know how to setup a wildcard rule to exclude .test.js files from coverage preprocessor.
The text was updated successfully, but these errors were encountered: