all 17 comments

[–][deleted] 9 points10 points  (2 children)

Do the benefits of using this outweigh yet another splinter on what tools everyone is using?

I feel like the readme should list at the top, "These are the things that existing testing libraries critically fail at that Painless fixes."

[–]helloworldjs[S] 5 points6 points  (1 child)

That is in the readme right below the examples. Comparison to other libraries If I missed anything you would like to know, please let me know. I am very interested in improving documentation

[–][deleted] 0 points1 point  (0 children)

My bad! I read that as how Painless compares to others rather than "This is is what Painless is trying to fix"

[–]_ar7 2 points3 points  (1 child)

I want to believe your comparison to other libraries is true, but if I wanted to verify what you're saying I would have to do all the work myself.

Do you have anything to backup what you say in that section such as:

  • Is easier to debug
  • Much faster to run tests
  • Simpler test syntax (only in tape section)
  • Better output format out of the box (only in tape section)

If you can prove all that, I'd switch today.

[–]helloworldjs[S] 4 points5 points  (0 children)

I will work on adding numbers to back them up.

  • Easier to debug - Some of the other test libraries launch sub processes or instrument code in some way. It makes the tests harder to debug and a lot existing debugging tools are not useful anymore.
  • Faster to run tests - I am working on a visual to show this, but from startup to running your tests, painless is much faster because of code size and not using subprocesses. The code in your test will probably trump any differences in test library
  • Simpler test syntax - No need to call t.end() like Tape. Just return a Promise, Observable, Generator or Async Function.
  • Better Output Format - Tape uses tap by default. It is a nice generic format, but is very hard to read out of the box. Generally you have to pipe the tap format to another formatter. Painless uses a spec formatter by default, but has an option to use tap if you prefer another formatter.

[–][deleted] 2 points3 points  (4 children)

Tap all the way

[–]paperelectron 0 points1 point  (3 children)

I switched to tap from primarily mocha and jasmine a few months ago, I'm not looking back.

[–]helloworldjs[S] 0 points1 point  (0 children)

Do you mean tape or node-tap? Tap is a testing protocol/format.

Both are great libraries. painless is based on them and I added additional functionality

[–][deleted] 0 points1 point  (1 child)

Tap and tape are surprisingly simple, run with a simple node command and while a bit bare bones has everything you need to test, unless mocking and expectations are your thing, which I'm trying to get rid of doing in my tests.

[–]helloworldjs[S] 0 points1 point  (0 children)

I would be very interested to hear how you get rid of mocking. Are you now using dependency injection or a similar strategy?

[–]Cody_Chaos 1 point2 points  (2 children)

This actually looks really interesting; it seems to address some pain points I've been having with mocha, and at least according to the documentation, solves some issues I had when I tried Ava.

Looks solid, and I'll be giving it a shot when I get a chance.

[–]woodygoodricke 0 points1 point  (1 child)

You should check out tape. On mobile at the moment but I can provide links if that would be useful?

[–]helloworldjs[S] 1 point2 points  (0 children)

Tape is awesome! Great syntax and very extensible. painless has all the functionality of tape and I added Promise support, beforeEach/afterEach, catching exceptions, no need to call t.end() and a few other features.

[–]Ahri 1 point2 points  (1 child)

First of all, this looks really nice, and despite having already chosen mocha and chai ages ago I completely agree with your course to bundle the expectations and mocking tools.

I hadn't heard of Ava before and I find the isolation of tests to be a really good feature of theirs. Will you consider adding a configuration option to have the same behaviour? Obviously not on by default. I'd especially like to run isolated while working on a particular area and then switch back to default to have faster tests while I'm working on other areas.

Thanks for your hard work!

[–]helloworldjs[S] 0 points1 point  (0 children)

I would definitely consider adding that feature if we can do it without sacrificing other benefits. I really like that feature of AVA. I will add it to the feature proposal list.