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

feat(vitest): add --disable-console-intercept option to allow opting-out from automatic console log interception #4786

Merged
merged 8 commits into from
Jan 12, 2024

Conversation

hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Dec 20, 2023

Description

Closes #1405

I'm not sure --spy-console-log is a good way to name this option. It might be better to negate the logic so that this option can be named as --keep-raw-console or something. I would appreciate if someone could help me with better wording and also what to put in doc/jsdoc.

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

Copy link

netlify bot commented Dec 20, 2023

Deploy Preview for fastidious-cascaron-4ded94 ready!

Name Link
🔨 Latest commit 256d65d
🔍 Latest deploy log https://app.netlify.com/sites/fastidious-cascaron-4ded94/deploys/658e94f5aadc4a000829e933
😎 Deploy Preview https://deploy-preview-4786--fastidious-cascaron-4ded94.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@hi-ogawa hi-ogawa force-pushed the feat-no-console-spy branch from 22a1d06 to 669c6f2 Compare December 20, 2023 06:54
@hi-ogawa hi-ogawa marked this pull request as ready for review December 20, 2023 07:39
@hi-ogawa hi-ogawa changed the title feat(vitest): add --spy-console-log option to allow disabling global console interception feat(vitest): add --spy-console-log option to allow opting-out from global console log interception Dec 20, 2023
@sheremet-va
Copy link
Member

I don't like the naming to be honest. Vitest doesn't "spy" on the console, it intercepts it. Maybe --disable-console-intercept?

@hi-ogawa hi-ogawa changed the title feat(vitest): add --spy-console-log option to allow opting-out from global console log interception feat(vitest): add --disable-console-intercept option to allow opting-out from global console log interception Dec 29, 2023
@hi-ogawa hi-ogawa changed the title feat(vitest): add --disable-console-intercept option to allow opting-out from global console log interception feat(vitest): add --disable-console-intercept option to allow opting-out from automatic console log interception Dec 29, 2023
@hi-ogawa
Copy link
Contributor Author

Thanks for the suggestion. I like --disable-console-intercept better as well. I think it also helps wording better in the doc.

@sheremet-va sheremet-va added this to the 1.2.0 milestone Jan 3, 2024
@sheremet-va sheremet-va merged commit 43fa6ba into vitest-dev:main Jan 12, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

console.log doens't work when there is an infinite loop after it.
2 participants