You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test('always returns true or false',t=>{constverify=fn=>any=>typeoffn(any)=='boolean';jsc.assert(jsc.forall('json',verify(checkDocument)));t.end();});
The problem is that since I'm not actually using an assertion the output is:
TAP version 13
# always returns true or false
1..0
# tests 0
# pass 0
# ok
When a property-based assertion fails, it breaks the test (which is nice) but not in a nice way:
TAP version 13
# always returns true or false
/Users/se/GitHub/schemas/node_modules/jsverify/lib/jsverify.js:360
throw new Error(formatFailedCase(r));
^
Error: Failed after 1 tests and 3 shrinks. rngState: 0016cda478925eb3f0; Counterexample: [];
Some libraries have support for property-based assertions, ideally with tape it'd look like this:
test('always returns true or false',t=>{constverify=fn=>any=>typeoffn(any)=='boolean';t.property('json',verify(checkDocument));t.end();});
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:
It might be nice/reasonable to have some kind of top-level const wrappedTape = tape.withAssertion(name, handler); kind of API? That way, you could add your own assertions safely, without affecting other consumers of tape in the same application.
Not polluting other tape instances with third-party assertions is definitely the way to go. May I perhaps suggest we can register more than one assertion so that we can integrate third-party assertions as seamlessly as possible (YMMV)? e.g.,
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: