add karma and test function