From 0afd789761b6d27e1aae3a96616ad16c49f25486 Mon Sep 17 00:00:00 2001 From: David Bruant Date: Tue, 7 Apr 2020 10:58:17 +0200 Subject: [PATCH] fix(zoe): improve assertSubset error message --- packages/zoe/src/objArrayConversion.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/zoe/src/objArrayConversion.js b/packages/zoe/src/objArrayConversion.js index fd5cd31dba8..d69b6a43e5f 100644 --- a/packages/zoe/src/objArrayConversion.js +++ b/packages/zoe/src/objArrayConversion.js @@ -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( + ', ', + )})`, + ); }); };