used to perform a [a, b, c] includes b or Set([a, b, c]) has b or Map([[a, aval], [b, bval]]) has b comparison between the expected and actual result like:
[a, b, c] includes b
Set([a, b, c]) has b
Map([[a, aval], [b, bval]]) has b
expected
actual
const t = new AftTest('description', () => null);await t.verify(() => 'foobarbaz', containing('bar')); // succeedsawait t.verify(() => [1, 2, 3, 4, 5, 6], containing(5)); // succeedsawait t.verify(() => new Set([1, 2, 3, 4, 5, 6], containing(5)); // succeedsawait t.verify(() => new Map([[5, 'five'], [6, 'six']]), containing(5)); // succeedsawait t.verify(() => 'foo', containing('oof')); // failsawait t.verify(() => new Map([[5, 'five'], [6, 'six']]), containing('five')); // failsawait t.verify(() => ['foobarbaz','wolfhound','racecar'], containing('bar')); // succeeds Copy
const t = new AftTest('description', () => null);await t.verify(() => 'foobarbaz', containing('bar')); // succeedsawait t.verify(() => [1, 2, 3, 4, 5, 6], containing(5)); // succeedsawait t.verify(() => new Set([1, 2, 3, 4, 5, 6], containing(5)); // succeedsawait t.verify(() => new Map([[5, 'five'], [6, 'six']]), containing(5)); // succeedsawait t.verify(() => 'foo', containing('oof')); // failsawait t.verify(() => new Map([[5, 'five'], [6, 'six']]), containing('five')); // failsawait t.verify(() => ['foobarbaz','wolfhound','racecar'], containing('bar')); // succeeds
the expected value
a new ValueContaining instance
ValueContaining
Generated using TypeDoc
used to perform a
[a, b, c] includes b
orSet([a, b, c]) has b
orMap([[a, aval], [b, bval]]) has b
comparison between theexpected
andactual
result like: