-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Running tests only for a module? #3542
Comments
You can edit karma.conf.js to include files only from the modules you need. Otherwise, you can modify the tests to use |
I was hoping for a cleaner solution, don't want getting merge conflicts when pulling updates from upstream. I would prefer to use a separate custom karma config but not sure how to make it run with Grunt. There are also subtleties when modifying karma:
One has to use the more verbose globs without braces instead. |
The other solution with
|
See working config in this commit: test(typeahead): add custom config for typeahead Custom Karma configuration to only run tests for typeahead module https://github.com/dmitriz/bootstrap/commit/f5e4dcbf009945a566142e33e97f3daab4b0eb30 |
To get around the ddescribe validation, just use grunt watch --force
# or
grunt --force I don't think we should change anything in the code to support this as we do want all the tests to run by default. Perhaps it's a good idea to add these instructions to the wiki. |
Thanks, it is better :) But still not ideal. When I am working on specific module, I want to keep running all related tests, not just ones I changed to |
Concerning running all tests... It takes 25 seconds (!) for the whole run on my Macbook Pro (8 GB RAM, 1600 MHz DDR3), I don't want to think how slow it is on cheaper less powerful machines. Worse - I get 3 full screens of warnings not related to the module I am working on - do you really want to see them all after every single edit? But wait - it gets even worse! |
Here I submitted a related PR: |
You can set As I said before, you can feel free to edit karma.conf.js locally. You don't need to commit it, you should in fact leave it unstaged so you know that you're setting up a custom environment just for working on that module. In that future, you want to reset that state. If anything, we should instead spend time and effort on making the tests run faster. |
Agreed with @chrisirhc here. And we should really remove |
Ah right, indeed, it makes sense to remove those fdescribe checks on each watch run. It can run it when it's not a watch statement or during the initial run but not on each subsequent watch run. |
Hm. I'm running it on my machine and I don't see the warnings on every run. I only see it on the initial run. Perhaps @dmitriz has a different configuration? |
I have created a Gist to demonstrate the testing output: By changing With But the problem is not the warnings, it is the 25 seconds to complete tests on each run I may be missing something but I can't understand how that can be practical. Is everyone doing TDD and working on the code, indeed running all 700+ tests upon each file save? |
I'm using |
It should be noted that |
I would like to run TDD tests only for a selected module. Is there any Grunt task for it?
Development instructions in
https://github.com/angular-ui/bootstrap/wiki/Development
only mention
grunt watch
, which is massive and slow.For specific modules, only
build:module
is mentioned,(whereas
watch:module
ignores themodule
),with further instructions somewhat sketchy:
"Check the Grunt build file for other tasks that are defined for this project."
I couldn't tell how to do it from looking to
Gruntfile.js
but I'm no "Grunt expert" (using Gulp instead, which I prefer by far).The text was updated successfully, but these errors were encountered: