Platform (inside Docker image node:12-slim): Linux 8798d6927954 5.3.0-7625-generic #27~1576774560~19.10~f432cd8-Ubuntu SMP Thu Dec 19 20:35:37 UTC x86_64 GNU/Linux
Version: v12.15.0 (latest at the moment of writing)
Run the following code in a NodeJS console.
const events = require('events')
new EventEmitter()
This is consistent.
The output between Node 12.x versions is the same.
$ node --version
v12.16.0
$ node
Welcome to Node.js v12.16.0.
Type ".help" for more information.
> const EventEmitter = require('events')
undefined
> new EventEmitter()
EventEmitter {
_events: [Object: null prototype] {},
_eventsCount: 0,
_maxListeners: undefined,
[Symbol(kCapture)]: false
}
$ node --version
v12.15.0
$ node
Welcome to Node.js v12.16.0.
Type ".help" for more information.
> const EventEmitter = require('events')
undefined
> new EventEmitter()
EventEmitter {
_events: [Object: null prototype] {},
_eventsCount: 0,
_maxListeners: undefined,
}
This broke our (admittedly badly written) Jest snapshots.
I don't think this is so much a bug as it is a cautionary tale to not test the output of debug APIs.
I don't think this is so much a bug as it is a cautionary tale to not test the output of debug APIs.
Yeah, I have to agree. The output here is generated by util.inspect() and is not really part of the public API contract for Node.js. It's really intended as debugging output exposing Node.js internals. Annoying? Yes. Bug? No.
I'm closing this as a wontfix.