Put process.stdout.write back even if test fails