web-component-tester compatibility with jsx type components

Skip to first unread message


Jun 1, 2021, 1:52:47 PM6/1/21
to Polymer
Hello! I was wondering if it is possible to use the web-component-tester(https://github.com/Polymer/tools/tree/master/packages/web-component-tester) with a jsx based component, I have tried doing the same but could not find a way to work this out. Even a yes/no would do good !



Jun 1, 2021, 3:30:55 PM6/1/21
to Polymer
Hi Shashwat,

web-component-tester was designed to address specific issues involved in testing components that use HTML Imports. Unless you're using an older version of the Polymer library (1.x or 2.x), you probably don't need web-component-tester at all. Both Polymer 3 and its successor, Lit, use standard JavaScript modules, so they can be used with a variety of test frameworks.

If you're using Polymer 3.x or Lit, you might look into Web Test Runner from the modern web project: https://modern-web.dev/docs/test-runner/overview/ (See also the short section in the Lit docs on testing: https://lit.dev/docs/tools/testing/).

I don't have any experience with using JSX with WCT, but definitely WCT doesn't have any built-in support for JSX. So if you're trying to use Polymer 1.x or 2.x with a JSX-based component, I believe you'd need to transform your JSX into standard JavaScript before testing with web-component-tester, 

Hope that helps,


Jun 1, 2021, 4:01:46 PM6/1/21
to Polymer
thanks a lot Arthur !
Reply all
Reply to author
0 new messages