mantoni / mochify.js

☕️ TDD with Browserify, Mocha, Headless Chrome and WebDriver
MIT License
346 stars 57 forks source link

Allow loading tests as esm modules #264

Closed m90 closed 2 years ago

m90 commented 2 years ago

This is a first attempt at https://github.com/mantoni/mochify.js/issues/249

This will currently just time out when using the JSDOM driver, not entirely sure if it's not supported or if it's my fault yet (leaving it a draft until then, but feel free to feedback already if you have some). I would also like to add some unit tests to this, especially around transposing file paths against the server root.

m90 commented 2 years ago

Ok, it seems this is not supported by JSDOM https://github.com/jsdom/jsdom/issues/2475 which is probably good an bad at the same time.

This opens up an interesting question though: in case we would like to have a driver throw in such a case (something is not supported by that particular driver), how does the driver even know about what it will be supposed to do very soon? Right now, all it ever sees is the driverOptions. Does this mean we also need to pass the options themselves to driver so they can validate them? Or do we rely on documenting things like this?

mantoni commented 2 years ago

Does this mean we also need to pass the options themselves to driver so they can validate them? Or do we rely on documenting things like this?

I didn't think about this case yet. Good question. Up for discussion, but I'd wait until we have at least two of those cases. That makes it easier to see a good solution.