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

How to console.log / debug tests #2

Open
Arinji2 opened this issue Oct 17, 2024 · 3 comments
Open

How to console.log / debug tests #2

Arinji2 opened this issue Oct 17, 2024 · 3 comments

Comments

@Arinji2
Copy link

Arinji2 commented Oct 17, 2024

Sorry had another issue, so how do we like console stuff out? It seems as if eslint has a console warn rule + i dont think console log works with testing.. are we not able to log out stuff?

@w3cj
Copy link
Owner

w3cj commented Oct 17, 2024

You will see all of the log outputs before the test results.

Screenshot 2024-10-17 at 8 24 39 AM

You can also try using the vitest extension: https://marketplace.visualstudio.com/items?itemName=vitest.explorer

This will allow you to run individual tests and see the output on the left:

Screenshot 2024-10-17 at 8 28 50 AM

You can also add break points in your code and press the play button with a bug on it, this will then stop the execution while the test is running and you can hover over variables / inspect the code during runtime:

Screenshot 2024-10-17 at 8 30 09 AM

@w3cj w3cj changed the title Console How to console.log / debug tests Oct 17, 2024
@Arinji2
Copy link
Author

Arinji2 commented Oct 17, 2024

Awesome thankyou so much. I am new to testing in my react code so this challenge is awesome :D
Again much appreciated for you helping me out <3

@Arinji2 Arinji2 closed this as completed Oct 17, 2024
@w3cj
Copy link
Owner

w3cj commented Oct 17, 2024

Keeping this one open as well in case others have the same question.

@w3cj w3cj reopened this Oct 17, 2024
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

No branches or pull requests

2 participants