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

Feature request: Add tests panel support #112

Closed
2 tasks done
mattphillips opened this issue Oct 25, 2021 · 6 comments · Fixed by #562
Closed
2 tasks done

Feature request: Add tests panel support #112

mattphillips opened this issue Oct 25, 2021 · 6 comments · Fixed by #562

Comments

@mattphillips
Copy link
Contributor

Tell us how you think we can improve Sandpack

Packages affected

  • sandpack-client
  • sandpack-react

What is this feature?

Would it be possible to support test files? Currently on codesandbox.io I can configure the sandbox view to show the tests panel which can run the tests.

How would your idea work?

Much like the sandpack-react does currently but with an additional view option which supports tests that instead of rendering the React component into the DOM it would run the test file with jest and display the results.

Do you have any examples of how you would like to see us implement it?

Sorry no real examples but the use case I have in mind is for a jest-extended docs site with an embedded repl (powered by Sandpack) that can run the examples for each matcher.

This would be preferable to creating a codesandbox per matcher and manually embedding it.

Here's an example of what I've currently configured in a sandbox if it's of any help.

I'm more than happy to get involved with building this if it's of value to the project, would just need some pointers on where to begin 😆

@danilowoz
Copy link
Member

Thanks for your feedback, @mattphillips!

I have added your feature request to our internal backlog which we use to prioritize what to build next. We can't make any promises about the timing, but it's on the list!

For others landing on this issue, feel free to add more context or simply leave a thumbs up 👍 on this comment if you find this feature useful.

@danilowoz
Copy link
Member

danilowoz commented Feb 2, 2022

Hey all! I'd like to hear your thoughts about this feature and get to understand what is the best approach for this:

  • I'm curious to know what kind of feature the Test component cannot miss?
  • Can you provide a great example of what would you consider an excellent test suit?
  • Are you happy with the current CodeSandbox component?

Feel free to drop any message here, and 👍 which one you like the most

@mattphillips
Copy link
Contributor Author

Hey @danilowoz

I'm curious to know what kind of feature the Test component cannot fail?

I'm not 100% sure what you mean with this so sorry if I've misunderstood.

Something I think is vital for this feature is being able to configure Jest itself. The original problem I wanted to solve is to write a repl for jest-extended (a library that provides additional matchers to Jest's expect) so we would need to be able to access the Jest's config to setup jest-extended.

Can you provide a great example of what would you consider an excellent test suit?

See: https://github.com/facebook/jest/blob/main/packages/jest-each/src/__tests__/index.test.ts

Are you happy with the current CodeSandbox component?

Yeah I think it looks pretty good atm, perhaps an improvement could be to control the test panel like you can Jest in watch mode.

@danilowoz
Copy link
Member

Sorry I meant to say: I'm curious to know what kind of feature the Test component cannot miss? But you got the point.

Thanks for leaving your feedback!

@mattphillips
Copy link
Contributor Author

Hey @danilowoz are there any updates on this? I'm happy to lend a hand to help get this built if someone can point me in the right direction 👍

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 a pull request may close this issue.

3 participants
@danilowoz @mattphillips and others