made karma test more flexible