-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: don't toggle cli cursor on non-TTY #7336
fix: don't toggle cli cursor on non-TTY #7336
Conversation
8389156
to
f80a646
Compare
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
@@ -509,8 +509,6 @@ export class Vitest { | |||
} | |||
|
|||
async collect(filters?: string[]): Promise<TestRunResult> { | |||
this._onClose = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these removals also the part of the fix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, currently all onClose
listeners were completely ignored for some reason.
vitest/packages/vitest/src/node/core.ts
Lines 120 to 124 in 926ca95
constructor( | |
public readonly mode: VitestRunMode, | |
options: VitestOptions = {}, | |
) { | |
this.logger = new Logger(this, options.stdout, options.stderr) |
vitest/packages/vitest/src/node/logger.ts
Lines 320 to 325 in 926ca95
this.ctx.onClose(() => { | |
process.off('SIGINT', onExit) | |
process.off('SIGTERM', onExit) | |
process.off('exit', onExit) | |
cleanup() | |
}) |
vitest/packages/vitest/src/node/core.ts
Lines 545 to 546 in 926ca95
async start(filters?: string[]): Promise<TestRunResult> { | |
this._onClose = [] |
This prevented cli cursor clearing. The added test case was failing without this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
##### [v3.0.5](https://github.com/vitest-dev/vitest/releases/tag/v3.0.5) ##### 🚀 Features - **ui**: Insert message "no tests found" in ui - by [@DevJoaoLopes](https://github.com/DevJoaoLopes) in vitest-dev/vitest#7366 [<samp>(92da4)</samp>](vitest-dev/vitest@92da490bd) ##### 🐞 Bug Fixes - Validate websocket request - by [@hi-ogawa](https://github.com/hi-ogawa) and [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#7317 [<samp>(191ef)</samp>](vitest-dev/vitest@191ef9e34) - Don't toggle cli cursor on non-TTY - by [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#7336 [<samp>(3c805)</samp>](vitest-dev/vitest@3c8050e69) - **vite-node**: Differentiate file url with hash and query - by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#7365 [<samp>(926ca)</samp>](vitest-dev/vitest@926ca9546) ##### [View changes on GitHub](vitest-dev/vitest@v3.0.4...v3.0.5)
##### [v3.0.5](https://github.com/vitest-dev/vitest/releases/tag/v3.0.5) This release includes security patches for: - [Remote Code Execution when accessing a malicious website while Vitest API server is listening | CVE-2025-24964](GHSA-9crc-q9x8-hgqq) ##### 🚀 Features - **ui**: Insert message "no tests found" in ui - by [@DevJoaoLopes](https://github.com/DevJoaoLopes) in vitest-dev/vitest#7366 [<samp>(92da4)</samp>](vitest-dev/vitest@92da490bd) ##### 🐞 Bug Fixes - Validate websocket request - by [@hi-ogawa](https://github.com/hi-ogawa) and [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#7317 [<samp>(191ef)</samp>](vitest-dev/vitest@191ef9e34) - Don't toggle cli cursor on non-TTY - by [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#7336 [<samp>(3c805)</samp>](vitest-dev/vitest@3c8050e69) - **vite-node**: Differentiate file url with hash and query - by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#7365 [<samp>(926ca)</samp>](vitest-dev/vitest@926ca9546) ##### [View changes on GitHub](vitest-dev/vitest@v3.0.4...v3.0.5)
##### [v3.0.5](https://github.com/vitest-dev/vitest/releases/tag/v3.0.5) This release includes security patches for: - [Remote Code Execution when accessing a malicious website while Vitest API server is listening | CVE-2025-24964](GHSA-9crc-q9x8-hgqq) ##### 🚀 Features - **ui**: Insert message "no tests found" in ui - by [@DevJoaoLopes](https://github.com/DevJoaoLopes) in vitest-dev/vitest#7366 [<samp>(92da4)</samp>](vitest-dev/vitest@92da490bd) ##### 🐞 Bug Fixes - Validate websocket request - by [@hi-ogawa](https://github.com/hi-ogawa) and [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#7317 [<samp>(191ef)</samp>](vitest-dev/vitest@191ef9e34) - Don't toggle cli cursor on non-TTY - by [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#7336 [<samp>(3c805)</samp>](vitest-dev/vitest@3c8050e69) - **vite-node**: Differentiate file url with hash and query - by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#7365 [<samp>(926ca)</samp>](vitest-dev/vitest@926ca9546) ##### [View changes on GitHub](vitest-dev/vitest@v3.0.4...v3.0.5)
##### [v3.0.5](https://github.com/vitest-dev/vitest/releases/tag/v3.0.5) This release includes security patches for: - [Remote Code Execution when accessing a malicious website while Vitest API server is listening | CVE-2025-24964](GHSA-9crc-q9x8-hgqq) ##### 🚀 Features - **ui**: Insert message "no tests found" in ui - by [@DevJoaoLopes](https://github.com/DevJoaoLopes) in vitest-dev/vitest#7366 [<samp>(92da4)</samp>](vitest-dev/vitest@92da490bd) ##### 🐞 Bug Fixes - Validate websocket request - by [@hi-ogawa](https://github.com/hi-ogawa) and [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#7317 [<samp>(191ef)</samp>](vitest-dev/vitest@191ef9e34) - Don't toggle cli cursor on non-TTY - by [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#7336 [<samp>(3c805)</samp>](vitest-dev/vitest@3c8050e69) - **vite-node**: Differentiate file url with hash and query - by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#7365 [<samp>(926ca)</samp>](vitest-dev/vitest@926ca9546) ##### [View changes on GitHub](vitest-dev/vitest@v3.0.4...v3.0.5)
Description
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yaml
unless you introduce a new test example.Tests
pnpm test:ci
.Documentation
pnpm run docs
command.Changesets
feat:
,fix:
,perf:
,docs:
, orchore:
.