-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: don't toggle cli cursor on non-TTY
- Loading branch information
1 parent
c60ee27
commit f80a646
Showing
4 changed files
with
39 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { expect, test } from 'vitest' | ||
import { runVitest } from '../../test-utils' | ||
|
||
test('cursor is hidden during test run in TTY', async () => { | ||
const { stdout } = await runVitest({ | ||
include: ['b1.test.ts'], | ||
root: 'fixtures/default', | ||
reporters: 'none', | ||
watch: false, | ||
}, undefined, undefined, undefined, { tty: true, preserveAnsi: true }) | ||
|
||
expect(stdout).toContain('\x1B[?25l') | ||
expect(stdout).toContain('\x1B[?25h') | ||
}) | ||
|
||
test('cursor is not hidden during test run in non-TTY', async () => { | ||
const { stdout } = await runVitest({ | ||
include: ['b1.test.ts'], | ||
root: 'fixtures/default', | ||
reporters: 'none', | ||
watch: false, | ||
}, undefined, undefined, undefined, { preserveAnsi: true }) | ||
|
||
expect(stdout).not.toContain('\x1B[?25l') | ||
expect(stdout).not.toContain('\x1B[?25h') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters