If you lean on static types and push conditionals down, you may be able to avoid testing glue code with integration tests.
constgo = () => {
const x = doA()
returnis(x) ? doB(x) : doC(x)
}
// ⛔️ Need two integration tests due to the conditional// ⛔️ If two conditionals are added, need eight tests
constgo = () => {
const x = doA()
doBOrC(x)
}
// ✅ Need two unit tests in doBOrC()// ✅ If two conditionals are added,// doBOrC() still needs two unit tests.