updated npm test to support events