Write test using Karma