DEV Community

Discussion on: Some things to know about Lit

Collapse
 
stefanonepa profile image
stefanonepa

Hi,
Thank you for giving me hope in testing web components in a third party webapp build with another framework. 🎉

I am currently investigating it with a spa based in vuejs and a web components framework called shoelace.

Do you think there are examples or opensource projects that show how to do it with libraries like jest for example? Because my issue actually is more about unit testing rather than e2e (which seems easier, but not there yet :D )

Thread Thread
 
stefanonepa profile image
stefanonepa

Btw, I didn't know spectrum, but I will definitely give it a try, it looks nice.

Thread Thread
 
westbrook profile image
Westbrook Johnson

Hrm, I don't have a whole lot of experience with Jest at all. I'm much more a "test in the browser you code runs" sort of person, and as such both contribute to and use modern-web.dev/docs/test-runner/ov... which is great for testing your units like a user would rather than like nodejs might. I also don't have a lot of experience with Vuejs, so I'm not sure how well they play together or not, either.

At its root, Jest runs off of jsDOM, which supports custom elements, so there shouldn't be an issue (assuming all modern versions of the test suite). The main place of learning may be in interacting with actual elements rather than virtual ones, but I can't really speak to that directly.

Thread Thread
 
westbrook profile image
Westbrook Johnson

We do our best, and would greatly appreciate any issues or discussions that you might bring to the project. Our goals are often different that those of Shoelace, at this time, but both of our projects are based on Lit, and both of our projects bring custom elements to a broader community of developers, so choose the one that best fits your needs!