refactor(runPrettier): replace multi-`.mockRestore()` with `jest.restoreAllMocks()`

master
ikatyang 2017-09-14 13:23:10 +08:00
parent 6f9da6441c
commit 6fa30d9ccf
1 changed files with 1 additions and 9 deletions

View File

@ -62,15 +62,7 @@ function runPrettier(dir, args, options) {
process.argv = originalArgv;
process.exitCode = originalExitCode;
process.stdin.isTTY = originalStdinIsTTY;
// TODO: use `jest.restoreAllMocks()` once facebook/jest#4436 fixed
spiedProcessExit.mockRestore();
spiedStdoutWrite.mockRestore();
spiedStderrWrite.mockRestore();
spiedConsoleLog.mockRestore();
spiedConsoleWarn.mockRestore();
spiedConsoleError.mockRestore();
spiedFsWriteFileSync.mockRestore();
jest.restoreAllMocks();
}
return { status, stdout, stderr, write };