Rest
...__namedParameters: MessageExtraAsserts that the emitter emits the specified event before the test ends. Returns a promise that resolves when the event is emitted. Note that waiting on the returned promise within a test can deadlock the test, if the event never emits, but the returned promise can be a handy way to pause a test until an event happens, if you are reasonably confident that it will fire.
Rest
...__namedParameters: MessageExtraVerify that the values are equal
Rest
...__namedParameters: MessageExtraAssert that an error object is not provided.
Like with @tapjs/asserts!index.Assertions#doesNotThrow, you can also usually just throw the error, and tap will handle that reasonably.
This is useful in cases where you just want to assert that a callback did not receive an error, without necessarily aborting the callback function entirely. Both the origin of the error and the location of the failed assertion will be printed in the test results.
It is also used internally in @tapjs/asserts!index.Assertions#resolves, @tapjs/asserts!index.Assertions#doesNotThrow, and @tapjs/asserts!index.Assertions#resolveMatch to show both the source of a raised error as well as the callsite where the assertion failed.
Rest
...__namedParameters: MessageExtraVerify that the object has all of the properties and values in the pattern, matching loosely.
Rest
...__namedParameters: MessageExtraVerify that the object has the wanted property, using Object#hasOwnProperty
Rest
...__namedParameters: MessageExtraVerify that the object has all of the properties listed in the
wanted
list, using Object#hasOwnProperties()
Rest
...__namedParameters: MessageExtraVerify that the object has all of the properties listed in the
wanted
list, using Object#hasOwnProperties(), and no others
Rest
...__namedParameters: MessageExtraVerify that the object has the wanted property, anywhere in its prototype chain.
Rest
...__namedParameters: MessageExtraVerify that the object has all of the properties in the wanted
list, anywhere in its prototype chain.
Rest
...__namedParameters: MessageExtraVerify that the value has all of the properties and values in the pattern, matching strictly.
Rest
...__namedParameters: MessageExtraVerify that the value matches the pattern provided
Rest
...__namedParameters: MessageExtraVerify that the value matches the pattern provided, with no extra properties.
Rest
...__namedParameters: MessageExtraVerify that the value matches the pattern provided, with no extra properties.
Rest
...__namedParameters: MessageExtraVerify that the value matches the pattern provided, but fail if any fields only match via type coercion.
For example,
t.matchStrict({ a: 1 }, { a: Number }, 'this passes')
t.matchStrict({ a: 1 }, { a: '1' }, 'this fails')
Rest
...__namedParameters: MessageExtraVerify that the values are not equal
Rest
...__namedParameters: MessageExtraVerify that the object does NOT have all of the properties and values in the pattern, matching loosely.
Rest
...__namedParameters: MessageExtraVerify that the value does NOT contain all of the properties and values in the test pattern, comparing strictly.
Note that this will pass if the value has some of the listed properties, or if they do not match the same type.
Rest
...__namedParameters: MessageExtraVerify that the value does NOT match the pattern provided.
Rest
...__namedParameters: MessageExtraVerify that the value does not match the pattern provided, with no extra properties. Ie, it might either not match, or have extra props.
Rest
...__namedParameters: MessageExtraVerify that the value does not match the pattern provided, with no extra properties. Ie, it might either not match, or have extra props.
Rest
...__namedParameters: MessageExtraVerify that the value does not match the pattern provided, without type coercion.
Rest
...__namedParameters: MessageExtraVerify that the value is not truthy
Rest
...__namedParameters: MessageExtraVerify that the value is not loosely equivalent to the supplied pattern
Rest
...__namedParameters: MessageExtraVerify that the value is truthy
Rest
...__namedParameters: MessageExtraresolves to the error object rejected if it rejects as expected, 'false' if it does not, or 'true' if it fails to reject but is marked as skip/todo.
Rest
...__namedParameters: ThrowsArgsTest the resolved promise result with t.match()
Resolves to true if it passes, false if the promise rejects or the match fails, or the rejection error value if the promise rejects but the assertion passes by being marked todo/skip.
Rest
...__namedParameters: MessageExtraResolves to 'true' if the promise resolves successfully, 'false' if it rejects and fails, or the rejection error if it rejects but the failure is accepted by by being marked todo or skip
Rest
...__namedParameters: MessageExtraVerify that the value is loosely equivalent to the supplied pattern
Rest
...__namedParameters: MessageExtraVerify that the value is not strictly equivalent to the supplied pattern object
Rest
...__namedParameters: MessageExtraVerify that the value is strictly equivalent to the supplied pattern
Rest
...__namedParameters: MessageExtraVerify that the function throws an error.
Thrown error is tested against the wanted
param if provided, using
t.match()
.
Returns false on failure, or the error object thrown on success
Rest
...__namedParameters: ThrowsArgsVerify that the value is of the type specified Type can be either a string, or a constructor.
If a string, then it can match either the typeof
result
or 'null' for null
values, or the name
property of the
object's constructor.
Rest
...__namedParameters: MessageExtra
Returns the error object if it throws and that does not fail the test (by virtue of being marked skip or todo). Otherwise returns the passing status, like other assertions.