parser.test.js 603 B

1234567891011121314151617181920212223242526
  1. var util = require('sys'),
  2. Events = require('events').EventEmitter,
  3. nodeunit = require('nodeunit'),
  4. testCase = require('nodeunit').testCase,
  5. StompFrame = require('../lib/frame').StompFrame;
  6. // Mock net object so we never try to send any real data
  7. var connectionObserver = new Events();
  8. connectionObserver.writeBuffer = [];
  9. connectionObserver.write = function(data) {
  10. this.writeBuffer.push(data);
  11. };
  12. module.exports = testCase({
  13. setUp: function(callback) {
  14. callback();
  15. },
  16. tearDown: function(callback) {
  17. connectionObserver.writeBuffer = [];
  18. callback();
  19. }
  20. });