diff --git a/assert.js b/assert.js index a9aa6ad..4e89129 100644 --- a/assert.js +++ b/assert.js @@ -130,6 +130,9 @@ assert.AssertionError = function AssertionError(options) { this.expected = options.expected; this.operator = options.operator; if (options.message) { + if (typeof options.message === 'function') { + options.message = options.message(); + } this.message = options.message; this.generatedMessage = false; } else {