Made tests work with latest version of Karma. Credit: https://github.com/warrenseymour