Open
Description
> var expect = require('unexpected');
> expect({a:1, b:2}, 'to have properties', ['a', 'b', 'c'])
UnexpectedError:
expected { a: 1, b: 2 } to have properties [ 'a', 'b', 'c' ]
This gets rather pointless when the tested object has more than a few dozen properties. And it doesn't tell you if it considers the required properties as strict set equality or a subset.
To get around this, I've re-purposed the code from #255 (comment) to this bastard-thing:
> expect(Object.keys({a:1, b:2}), 'to be a subset of', ['b', 'c']);
expected [ 'a', 'b' ] to be a subset of [ 'b', 'c' ]
[
'a', // should be removed
'b'
]
(Yes, I know the assertion isn't the same, but it illustrates the difference in output quite well.)