Skip to content

Instantly share code, notes, and snippets.

@keithstric
Last active February 17, 2020 15:22
Show Gist options
  • Save keithstric/9836335df3f89f72407da417501fe24b to your computer and use it in GitHub Desktop.
Save keithstric/9836335df3f89f72407da417501fe24b to your computer and use it in GitHub Desktop.
Adventures in Unit Testing 1
const EventEmitter = require('events').EventEmitter;
global.customEmitter = new EventEmitter();
let evtCount = 0;
module.exports = function someFunction() {
global.customEmitter.addListener('foo', somePrivateFunction);
}
function somePrivateFunction() {
evtCount++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment