redding / assert

Assertion style testing framework.
https://github.com/redding/assert
MIT License
10 stars 1 forks source link

debug mode: bench showing debug msg immediately; show timing on finish #257

Closed kellyredding closed 8 years ago

kellyredding commented 8 years ago

This addresses issue 256. On test suites that are large (many test files to require or complicated env setup in the test helper), debug mode is only somewhat helpful. On the longer init steps (ie requiring the test helper and requiring the test files) assert would just stare blankly at you while stuff was happening but you didn't know what it was doing. Only once the step was complete did you know what it was doing. This is not great UX.

This updates the bench logic to pring the debug msg immediately to show that this step has begun and we are waiting on it. Then when the step is done the timing info is displayed as before. This lets the developer see that something is going on and start mentally estimating how long it has taken so far.

This also justifies the output so the timing info is easier to read. Again, just trying to improve the UX a bit.

Closes #256

@jcredding ready for review. This was driving me insane on our big app. I was wondering why the test suite was taking so long to start so I reran in debug mode. Then assert just stared at me while something was going on (but I didn't know what) (spoiler: it was taking over 30s to require all the test files).

jcredding commented 8 years ago

@kellyredding - I'm good with this :boom: I agree, it's better UX to see it say that it's doing something before it does it instead of waiting until after.