-
-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any tips on how to add new assertions? #555
Comments
There is no official or supported way to add assertions. That said, you could import https://github.com/substack/tape/blob/master/lib/test.js and mutate it with your own assertions - I do this in a project or two (example). However, it could break even in a patch release, so use it at your own risk. |
It might be nice/reasonable to have some kind of top-level |
That is pretty much what I was thinking. Not polluting other const test = require('tape').withAssertions(['foo', fn], ['bar', fn], ...)
test('...', t => {
t.foo(...);
t.bar(...);
t.end();
}); |
I went with a slightly simpler API - If a call-this operator existed, this would be native, but this will have to do in the meantime. |
Hi all,
I use
jsverify
withtape
. It looks like this:The problem is that since I'm not actually using an assertion the output is:
When a property-based assertion fails, it breaks the test (which is nice) but not in a nice way:
Some libraries have support for property-based assertions, ideally with
tape
it'd look like this:So I'm looking into adding a new assertion
t.property
and have failures properly reported. Ideally I would want this as a plugin e.g.tape-jsverify
.Is there any documentation, code or other tape plugin you would recommend I take a look at? Just looking for some info from the maintainers to get me started in the right direction (hopefully).
If
tape
doesn't really support third-party assertions, that's good to know too.Thanks!
The text was updated successfully, but these errors were encountered: