GetEmitOutput function and testfiles

Correct to "writer" in the comment as well, and use an arrow function instead.