Reading the rest of the patch and coming back to this, I think you should just copy what I did with TextEncoder/TextDecoder, and attach them to node's global for the testing environment.