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

Show tests results in preview #435

Open
iliakan opened this issue Jan 19, 2025 · 2 comments
Open

Show tests results in preview #435

iliakan opened this issue Jan 19, 2025 · 2 comments
Labels
question Question related to TutorialKit that doesn't require changes in codebase.

Comments

@iliakan
Copy link

iliakan commented Jan 19, 2025

Hello!

We'd like to add a "Run tests" button near the current "Toggle terminal", which would npm run test and show results instead of preview.

How should we approach this? Especially regarding replacing the "Preview" with the npm run test output?

@AriPerkkio
Copy link
Member

The Toggle terminal button cannot be replaced with custom buttons. However you can hide the button by specifying previews: false, and provide your own Run tests button in the lesson content.

Here's example where preview is not shown, and by clicking Run tests user can see results of that instead of the preview: https://tutorialkit.dev/guides/how-to-use-tutorialkit-api/#write-to-terminal

tutorialkit-run-tests-example.webm

@AriPerkkio AriPerkkio added the question Question related to TutorialKit that doesn't require changes in codebase. label Jan 23, 2025
@iliakan
Copy link
Author

iliakan commented Jan 23, 2025

Thank you for the response!

UX-wise, it would be great if we could have the button to run tests somewhere near the code (e.g. near "Solve" or "Toggle terminal"). And also open the results/switch to the test results terminal instead of the preview.

I wonder if you have anything like this on the roadmap ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question related to TutorialKit that doesn't require changes in codebase.
Projects
None yet
Development

No branches or pull requests

2 participants