Add tests for loopTask