$ npm install numbat-collector-mocka mock numbat collector server for your tests
var numbat = require('numbat-emitter')
var collectorMock = require('numbat-collector-mock')
// connect and make the mocking server
var emitter = new numbat({uri:'tcp://localhost:3333',app:'test'})
var collector = numbatMock()
// send a metric
emitter.metric({
name:"foo"
})
// get the results
collector.finished(function(err,metrics){
console.log(metrics[0].name === 'test.foo')
})
Test that your application code is sending the metrics you intend.
Use this function after your code should have passed metrics to numbat-emitter. it will carefully handle the callback so it get's triggered at the right time. It will dispose of the server and close any numbat-emitter connections so that you can get a clean start for the next test.