Skip to content

Commit

Permalink
fix(zoe): improve assertSubset error message (#873)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBruant authored Apr 7, 2020
1 parent 13fca7d commit 4c6f11f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/zoe/src/objArrayConversion.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ export const objToArray = (obj, keywords) => {
export const assertSubset = (whole, part) => {
part.forEach(key => {
assert.typeof(key, 'string');
assert(whole.includes(key), details`key ${key} was not an expected key`);
assert(
whole.includes(key),
details`key ${key} was not one of the expected keys (${whole.join(
', ',
)})`,
);
});
};

Expand Down

0 comments on commit 4c6f11f

Please sign in to comment.