samedi 25 janvier 2020

How to run all tests for particular file?

The question I have can be paraphrased like this:

How not to run all the tests in a project every time?  
How to run tests only for changed files?  
How to track which tests cover which files?  

So, I have a project and want to test all changes I made. I know which files I changed:

git diff --name-only

I don't want to run all the tests in my project and need to find tests that cover only changed sources
I could do it if I had a tree of dependencies and here comes my problem and question
Find static dependencies can be done with dependency-tree
But there are a lot of dynamic dependencies in my project, synthetic example:

const m = require(Math.random() > 0.5 ? 'a' : 'b')

I failed to find a tool to help me, so started with my own, but is there really no solution? (And of course I am scared with 60+Mb node_modules that come with dependency-tree)

Aucun commentaire:

Enregistrer un commentaire