elm-test
elm-test copied to clipboard
Proposal: pretty test runner in browser
@michaelbjames is working on performance benchmarking this summer, and we are drawing on this library for design inspiration a bit. One thing we came up with as a way to profile rendering was actually running the tests in browser. And if we are in the browser, we might as well have a progress bar as things run and then render some graphs when all the info is ready.
So the idea is, what if there was a test runner along these lines:
run : [Test] -> Element
run : [Test] -> Signal Element
In the second case you could show incremental results as the tests run. This would hook up to main
so I don't think it'd interfere with running things on the command line.
I've thought about doing this before. I'll give it some thought as to how to best do it now.
Cool :) We'll be doing some visual stuff with benchmarking, so maybe we can share code or at least share style a bit if you think it's a good idea.
The only way I know to do this (make a "pure" signal) is to have a foldp
/automaton
running one test at each step and then have that run on a super fast "pumping" signal like every millisecond
. It's how IO
used to work.
I've figured out how to do this with a simple native JS extension. I just created a native
branch where I'm working on it.
Thanks to Michael's benchmarking code, anyway. I read through that to get an idea of how it all fits together.