deadfoxygrandpa / elm-test

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

Add pass and fail assertions. #37

Closed mgold closed 8 years ago

mgold commented 8 years ago

These allow elm-check to rely on elm-test's runners, by converting the results of property-based checks to passing or failing. This means less duplicated work writing runners, and allows for property-based and unit testing to be used easily in the same test suite.

Previously, I had written a function to take the output of elm-check and turn it into tests, by assert True and assert False. This "worked", in that you could read the output, but it was cluttered with extra information on the ends of the lines:

screen shot 2016-02-05 at 11 40 44 am

With these new functions, and a bit of cleverness in the elm-check to elm-test conversion function, tests now look like this:

screen shot 2016-02-05 at 11 40 55 am

I'd like to go further and add "passed n checks" on the end, but that's more invasive, so I'll start with this.

This branch is based on taskrunner since I see that's where recent development is. Also, +1 for dropping 0.15 support in elm-package.json. I also cleaned up a few things I came across exploring the codebase. Releasing these changes will be a minor version bump.

deadfoxygrandpa commented 8 years ago

OK, this makes sense.

mgold commented 8 years ago

Great thanks! Any timeline on when this will get merged into master and released?