deadfoxygrandpa / elm-test

A unit testing framework for Elm
MIT License
204 stars 21 forks source link

Proposal: pretty test runner in browser #7

Open evancz opened 10 years ago

evancz commented 10 years ago

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

deadfoxygrandpa commented 10 years ago

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

evancz commented 10 years ago

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.

maxsnew commented 10 years ago

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.

deadfoxygrandpa commented 10 years ago

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 commented 10 years ago

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