Open xko opened 1 year ago
jsdom itself does not support ECMAScript modules: https://github.com/jsdom/jsdom/issues/2475 Until it does, there is nothing we can do here.
You may want to try https://github.com/scala-js/scala-js-env-selenium instead.
@sjrd I've tried Selenium to run Scala.js tests using DOM, but I encountered another issue reported in https://github.com/scala-js/scala-js-env-selenium/issues/128 It seems ESModule can't be used with Selenium probably because module files are accessed using relative paths.
ok. I've found a workaround to use Scala.js + jsdom + Selenium Chrome Driver. Leaving an example project here, which works with Vite, ScalablyTyped, Selenium, jsdom: https://github.com/xerial/scalajs-selenium
After completing the initial vite tutorial, I started looking for the way to UT the actual DOM generated. JsDom was recomended by older tutorial, so I gave it a try. It failed with:
IMO it's likely to confuse many new users. Since the modular config is now the default, would be nice to have it supported here. If not, what's currently the best approach to the DOM testing?