standard-log 7.0.0 → 7.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1232,7 +1232,7 @@ exports.config = function config(options) {
1232
1232
  if (store_1.store.value.mode === 'production') {
1233
1233
  throw new errors_1.ProhibitedDuringProduction('config');
1234
1234
  }
1235
- if (store_1.store.value.mode === 'test') {
1235
+ if (store_1.store.value.mode === 'test' && options.mode !== 'test') {
1236
1236
  var log = (0, getLogger_1.getLogger)('standard-log');
1237
1237
  log.warn("already configured for test, ignoring config() call");
1238
1238
  return;
@@ -2223,7 +2223,11 @@ function createGetLogMessage() {
2223
2223
  function toMessageWithLevel(logs) {
2224
2224
  return logs.map(toInspectStringForObject_1.toInspectLogEntry)
2225
2225
  .map(function (log) { return "".concat((0, formatter_1.formatLogLevel)(log.level), " ").concat(log.args.join(' ')); })
2226
- .join('\n');
2226
+ .join('\n')
2227
+ // if it has more than this log,
2228
+ // we assume it is running under tests,
2229
+ // and remove this log to simplify testing.
2230
+ .replace(/^\(WARN\) already configured for test, ignoring config\(\) call\n/, '');
2227
2231
  }
2228
2232
  exports.toMessageWithLevel = toMessageWithLevel;
2229
2233
  function createMemoryLogReporter(options) {
Binary file