Upgraded karma and add test coverage