diff options
Diffstat (limited to 'src/ts/utils/assert.ts')
-rw-r--r-- | src/ts/utils/assert.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ts/utils/assert.ts b/src/ts/utils/assert.ts index 7fb51fbdc..972047118 100644 --- a/src/ts/utils/assert.ts +++ b/src/ts/utils/assert.ts @@ -22,8 +22,10 @@ export const assert = { const schemaValidator = new SchemaValidator(); const validationResult = schemaValidator.validate(value, schema); const hasValidationErrors = validationResult.errors.length > 0; - const assertMsg = `Expected ${variableName} to conform to schema ${schema.id}, encountered: $value`; - this.assert(!hasValidationErrors, assertMsg); + const msg = `Expected ${variableName} to conform to schema ${schema.id} +Encountered: ${JSON.stringify(value, null, '\t')} +Validation errors: ${validationResult.errors.join(', ')}`; + this.assert(!hasValidationErrors, msg); }, assert(condition: boolean, message: string) { if (!condition) { |