run test when source is changed ..
recca0120 opened this issue · 4 comments
Hi.
I have two file
sum.js
sum.spec.js
when I edit sum.js, tester can execute sum.spec.js?
Hallo,
I had same idea, but ... The problem here is that the tester must recognize the dependencies of the file and run the test of the correct file.
At the moment, I do not have a solution for this. Maybe later I can find the time for this.
Maybe we can reverse-engineer the "watch" mode in Jest. Jest --watch -o
supports this feature. No idea, how they're doing it, though.
Jest builds files map for dependencies and shows what was changed since last commit. This works with javascript and git fine.
Unfortunately this issue is something more:
- Tester package was build with idea that any programming language can be supported and this means in turn that it is not easy to find dependencies between files. You can of course allow providers to look for dependencies between files, but this will already be a push principle (currently pull) and will require constant monitoring of all project files from all providers. This completely contradicts the current concept.
- Tester was also build for fast testing in current opened file and all features are concentrated on this: gutter decorations, status bar counter and current file event triggers (test on open or save).
So after the research, I realized that this problem will solve a another plugin which is concentrated only on one technology and/or one programming language. But I'm always open to new suggestions, maybe I missed something.
At the moment I can only suggest an experimental "Test all opened files after any save action" feature that is available since version 0.3.1.
I think the issue can be closed. The "Test Project" feature can be used to run test in modified scope (with -o flag for jest or .only
for mocha). If someone has better ideas please let me know :)