fix test helpers to handle res.format