Spot the bug in the debt retirement check

from Technical debt
Node 24 intermediate 4 min 1 issue to find

Find the bug in this retirement check, which requires both behavioral and structural evidence.

JavaScript
function canRetire(item) {
  const required = ['contract-tests', 'dependency-rule'];
  return required.some((name) => item.evidence.includes(name));
}

const debt = { evidence: ['contract-tests'] };
console.log(canRetire(debt));
Open in playground
Report an error