<commit_before>var assert = require('assert');
var EventEmitter = require('events').EventEmitter;
var util = require('util');


var client;
test("should connect to server", function(done) {
  client = require('riemann').createClient();
  assert(client instanceof EventEmitter);
  client.on('connect', done);
});


var server_down;
test("should fire error event", function(done) {
  server_down = require('riemann').createClient({port: 66500});
  server_down.on('error', done);
});


test("should send an event as udp", function(done) {
  client.send(client.Event({
    service : 'hello_udp',
    metric  : Math.random(100)*100,
    tags    : ['bar'] }), client.udp);
  done();
});<commit_msg>allow test of failure condition to actually be considered a pass.<commit_after>var assert = require('assert');
var EventEmitter = require('events').EventEmitter;
var util = require('util');


var client;
test("should connect to server", function(done) {
  client = require('riemann').createClient();
  assert(client instanceof EventEmitter);
  client.on('connect', done);
});


var server_down;
test("should fire error event", function(done) {
  server_down = require('riemann').createClient({port: 66500});
  server_down.on('error', function(e) {
    assert(e instanceof Error);
    done();
  });
});


test("should send an event as udp", function(done) {
  client.send(client.Event({
    service : 'hello_udp',
    metric  : Math.random(100)*100,
    tags    : ['bar'] }), client.udp);
  done();
});
{'fraction_non_alphanumeric': 0.16945746818486268, 'fraction_numerical': 0.014735432016075016, 'mean_word_length': 5.024193548387097, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4398181', 'n_tokens_mistral': 473, 'n_tokens_neox': 456, 'n_words': 116}