Skip to content

Commit d07ae27

Browse files
committed
Use ansi-escapes to clear two lines.
1 parent 54b2c75 commit d07ae27

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/jest-cli/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"version": "15.0.2",
55
"main": "build/jest.js",
66
"dependencies": {
7+
"ansi-escapes": "^1.4.0",
78
"callsites": "^2.0.0",
89
"chalk": "^1.1.1",
910
"graceful-fs": "^4.1.6",

packages/jest-cli/src/jest.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const TestRunner = require('./TestRunner');
2424

2525
const {Console, clearLine} = require('jest-util');
2626
const {run} = require('./cli');
27+
const ansiEscapes = require('ansi-escapes');
2728
const chalk = require('chalk');
2829
const formatTestResults = require('./lib/formatTestResults');
2930
const os = require('os');
@@ -309,7 +310,7 @@ const runCLI = (
309310
break;
310311
case KEYS.ESCAPE:
311312
isEnteringPattern = false;
312-
clearLine(pipe);
313+
pipe.write(ansiEscapes.eraseLines(2));
313314
currentPattern = argv._[0];
314315
break;
315316
default:

0 commit comments

Comments
 (0)