pino-debug icon indicating copy to clipboard operation
pino-debug copied to clipboard

allows debug calls prior to instantiation

Open audishos opened this issue 5 years ago • 4 comments

deletes debug module caches and reloads debug

audishos avatar Jun 10 '20 17:06 audishos

Codecov Report

Merging #28 into master will decrease coverage by 8.00%. The diff coverage is 54.54%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #28      +/-   ##
==========================================
- Coverage   98.00%   90.00%   -8.00%     
==========================================
  Files           2        2              
  Lines          50       60      +10     
==========================================
+ Hits           49       54       +5     
- Misses          1        6       +5     
Impacted Files Coverage Δ
index.js 86.95% <54.54%> (-10.27%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update eccac78...ae5acf7. Read the comment docs.

codecov-commenter avatar Jun 10 '20 17:06 codecov-commenter

Good work, would you mind to add a unit test?

mcollina avatar Jun 11 '20 06:06 mcollina

Hmmm. I'm not exactly sure what I'm doing wrong here. It's throwing within the test and failing, but not when I implement it in my project. Any thoughts?

test('allows calls to debug before calling pinoDebug', (t) => {
  var debug = require('debug')('ns')
  debug('test')
  t.doesNotThrow(() => require('../'))
  t.end()
})

audishos avatar Jun 12 '20 19:06 audishos

Looking at this it makes it seem like we'd need an ESM compatible pino-debug and a CommonJS one.

jmealo avatar Sep 07 '22 14:09 jmealo