Open
Description
The message
property in t.throws
is really ergonomic - it can be a string
, RegExp
, or even a function. t.like
should be just as ergonomic with strings:
const output = foo();
t.like(output, {
name: 'foo',
source: /foo comes from/,
});
A motivating example is trying to convert this test from npm-user
to use t.like
:
const user = await npmUser('sindresorhus');
t.like(user, {
name: 'Sindre Sorhus',
avatar: /npm-avatar/,
email: '[email protected]',
});