dont-break
dont-break copied to clipboard
Check if dependent module actually depends on this module first
Otherwise the copy / tests can fail and give invalid answer
When doing this you may want to consider checking dependencies, devDependencies and peerDependencies. I say this as some tools are meant to be dev dependencies such as mocha, eslint, or babel.
Let's say we have a 3 level deep hierarchy like this:
module C -> module B -> module A
If we want dont-break to run all the tests from all the upstream dependents of module A then the .dont-break.json looks like this:
[
"https://github.com/user/moduleB",
"https://github.com/user/moduleC"
]
At this point, based on the above configuration file, dont-break is syncing and running the tests from the modul B as expected, but then it fails after syncing module C because it checks to see whether C is directly depending on A which is not the case.
I think this direct dependency check is not needed and it should be removed.