generate code for karma