Hey all, I apologize if this has already come up (I tried to search for a similar issue but haven't found one), but has there been any consideration for a plugin/middleware system for tape instead of a write-a-wrapper type extension system?
I came to tape for the simplicity it offers, after getting frustrated with certain design decisions in mocha.
I want to use both tape-catch and blue-tape and it looks like it's currently impossible with the write-a-wrapper method unless you wrote a wrapper that did both. That approach is wasteful, IMO, and it would be better to just pick a method that allows for easier composition, like a plugin system. Of course, a plugin/middleware system is not without it's complexity.
Oh I wanted to note that I am aware I can get past the tape-catch + blue-tape issue with the tools at hand, I just wanted to know if there was any thought in this direction so far.
I took a look at tape-catch, and I'd highly advise against using that module or general approach.
If a test fails, you want to stop execution of the suite.
If you allow the continuation of suite after a test has failed, you will get unknown behavior.
Thanks for the advice @Marak , what I was hoping to get out of tape-catch was to make sure the test fails when any uncaught exception is thrown.
I'm perfectly fine using tape as it is right now actually (as my issue can be solved by just depending on tape.pass(...) for the async stuff I'm running, but I'm just wondering about how in general tape is supposed to be extended.
@t3hmrman
I think it might be safe to assume that if the test suite throws an exception, the test is going to fail anyway.
What's the actual issue this was causing you? Is not having the test complete as a failed test causing your other tooling to break?
Tape is a stream; it can definitely be wrapped. I wouldn't recommend it by
any means (I've stopped using all my wrappers), but if you insist on
finding a way to do it perhaps https://github.com/hughsk/smokestack or
https://github.com/yoshuawuyts/cuke-tap could serve as a reference. Cheers
On Fri, Jan 20, 2017 at 2:07 PM Marak notifications@github.com wrote:
@t3hmrman https://github.com/t3hmrman
I think it might be safe to assume that if the test suite throws an
exception, the test is going to fail anyway.What's the actual issue this was causing you? Is not having the test
complete as a failed test causing your other tooling to break?—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/substack/tape/issues/341#issuecomment-274067906, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ACWleojHfZA6d35g1c1MvcXXeGKNeLCGks5rULF5gaJpZM4Lo3zb
.
Wrapping is the proper approach; plugin systems are always a nightmare, and a huge part of tape's value is that it's simple.
I don't know how you'd make a test runner out of plugins. Plugins can only really work if (a) each plugin is independent in functionality and (b) if the order in which the plugins are executed is of no consequence. There's not a lot of software where (a) or (b) holds true, and especially not both.
Most helpful comment
Wrapping is the proper approach; plugin systems are always a nightmare, and a huge part of tape's value is that it's simple.