test: fix one of the Encoder tests
encoder: emit the "end" event

This fixes all the tests for now.