elm-test icon indicating copy to clipboard operation
elm-test copied to clipboard

Proposal: pretty test runner in browser

Open evancz opened this issue 10 years ago • 5 comments

@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.

evancz avatar Jun 03 '14 11:06 evancz

I've thought about doing this before. I'll give it some thought as to how to best do it now.

deadfoxygrandpa avatar Jun 03 '14 11:06 deadfoxygrandpa

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.

evancz avatar Jun 03 '14 15:06 evancz

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.

maxsnew avatar Jun 03 '14 17:06 maxsnew

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.

deadfoxygrandpa avatar Jul 10 '14 08:07 deadfoxygrandpa

Thanks to Michael's benchmarking code, anyway. I read through that to get an idea of how it all fits together.

deadfoxygrandpa avatar Jul 10 '14 08:07 deadfoxygrandpa