fix(karma): inject optional dependencies in karma tests