Add tests for ceylon.interop.browser
The browser interop module has no tests, we should try to add some at least so we perhaps could have caught https://github.com/ceylon/ceylon/issues/6473 sooner.
Yeah, I don't have a single clue on how to do that, the module is 100% dynamic interfaces, so I don't think we can make automated tests. The best solution I can think of right now, is writing a module that calls every dynamic class/interface, and then periodically (and manually) run this module in every major browser to see if there are errors...
Well we could:
- Write a module to run the tests in the browser, complete with the necessary boilerplate HTML
- Within the ceylon test tests fire up a http server to serve that page
- Use ceylon.process to fire up a browser pointed at the http server
It would be quite a lot of work, but it would make it relatively easy to ensure the tests were run on developer machines.
For extra points we run ceylon test-js from within the browser ;-)
This is really a whole ceylon test-browser tool, I suppose.
I've put together a proof of concept for this browser test tool here. I'd be grateful if someone could give it a try and see if it works for them.
Very cool! This worked for me. The two extra things I had to do:
- Add firefox to my path, which for me was
export PATH=/Users/jvasileff/Applications/Firefox.app/Contents/MacOS:$PATH - Compile the subject with
ceylon compile-js --source test. Maybe add a.ceylon/configfile?
Thanks @jvasileff I've updated the README.md to mention the $PATH, and added the .ceylon/config I was using.
I added a couple of very simple tests in ec50440 which you can run using the tool I wrote on Friday. I don't propose to add any more until we're figured out better what the tool should look like.