From 0339a0df243d6eb9e8ace3f9113dc86d66edb55a Mon Sep 17 00:00:00 2001 From: Jaime Leonardo Suncin Cruz Date: Sun, 3 Jun 2018 20:11:05 -0600 Subject: [PATCH] fix: Use default colorName in order to prevent issue with Mocha 5 There's an error when use `captains-log` with Mocha 5, maybe due how mocha mocks/intercepts console logging (I don't know for sure). fixes balderdashy/sails/#4395 --- lib/configure.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/configure.js b/lib/configure.js index d50d962..5616595 100644 --- a/lib/configure.js +++ b/lib/configure.js @@ -153,7 +153,7 @@ module.exports = function(overrides) { // Use the appropriate color for the log level. var colorMappings = _.isObject(options.colors) ? options.colors : {}; - var colorName = colorMappings[logAt]; + var colorName = colorMappings[logAt] || DEFAULT.OVERRIDES.colors[logAt]; // Get the ANSI-colorized prefix. var colorizedPrefix = (function _getColorizedPrefix() {