A Twitch.tv viewer reward and games system.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
520 B

12 years ago
  1. var common = require('../../common');
  2. var connection = common.createConnection();
  3. var assert = require('assert');
  4. connection.connect();
  5. var gotEnd = false;
  6. connection.on('end', function(err) {
  7. assert.equal(gotEnd, false);
  8. assert.ok(!err);
  9. gotEnd = true;
  10. });
  11. var gotCallback = false;
  12. connection.end(function(err) {
  13. if (err) throw err;
  14. assert.equal(gotCallback, false);
  15. gotCallback = true;
  16. });
  17. process.on('exit', function() {
  18. assert.equal(gotCallback, true);
  19. assert.equal(gotEnd, true);
  20. });