tests: add test for res.flush()