Skip to content
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

createVitest should also use registerConsoleShortcuts #3561

Closed
6 tasks done
deot opened this issue Jun 13, 2023 · 1 comment · Fixed by #3563
Closed
6 tasks done

createVitest should also use registerConsoleShortcuts #3561

deot opened this issue Jun 13, 2023 · 1 comment · Fixed by #3563
Labels
enhancement New feature or request
Milestone

Comments

@deot
Copy link
Contributor

deot commented Jun 13, 2023

Describe the bug

When I use createVitest to apply the test case, I can't respond to the terminal input, but startVitest can.

  • createVitest
import { createVitest } from 'vitest/node'

const vitest = await createVitest('test', {
  watch: true
})
vitest.start()
  • startVitest
import { startVitest } from 'vitest/node'

await startVitest('test', [], {
  watch: true
})

I compared the two methods and found that only startVitest called registerConsoleShortcuts(link). I think createVitest should also use registerConsoleShortcuts when it executed first time.

Reproduction

link

  • createVitest

CleanShot 2023-06-13 at 17 57 24

  • startVitest

CleanShot 2023-06-13 at 18 00 45

System Info

System:
    OS: macOS 12.6.3
    CPU: (8) x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
    Memory: 673.48 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 19.8.1 - ~/.nvm/versions/node/v19.8.1/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v19.8.1/bin/yarn
    npm: 9.5.1 - ~/.nvm/versions/node/v19.8.1/bin/npm
  Browsers:
    Chrome: 113.0.5672.92
    Firefox: 98.0
    Safari: 16.3

Used Package Manager

npm

Validations

@stackblitz
Copy link

stackblitz bot commented Jun 13, 2023

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@sheremet-va sheremet-va added enhancement New feature or request and removed pending triage labels Jun 13, 2023
@sheremet-va sheremet-va added this to the 0.32.1 milestone Jun 13, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jun 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants