io.test.js 731 B

12345678910111213141516171819202122232425262728293031
  1. /*!
  2. * socket.io-node
  3. * Copyright(c) 2011 LearnBoost <dev@learnboost.com>
  4. * MIT Licensed
  5. */
  6. (function (module, io, should) {
  7. module.exports = {
  8. 'client version number': function () {
  9. io.version.should().match(/([0-9]+)\.([0-9]+)\.([0-9]+)/);
  10. },
  11. 'socket.io protocol version': function () {
  12. io.protocol.should().be.a('number');
  13. io.protocol.toString().should().match(/^\d+$/);
  14. },
  15. 'socket.io available transports': function () {
  16. (io.transports.length > 0).should().be_true;
  17. }
  18. };
  19. })(
  20. 'undefined' == typeof module ? module = {} : module
  21. , 'undefined' == typeof io ? require('socket.io-client') : io
  22. , 'undefined' == typeof should ? require('should') : should
  23. );