Created
          June 2, 2011 20:20 
        
      - 
      
- 
        Save dvv/1005221 to your computer and use it in GitHub Desktop. 
    socket.io-node.0.7-tests
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | var assert = require('assert'); | |
| var http = require('http'); | |
| function server(port) { | |
| var srv = http.createServer(function(req, res) { | |
| res.writeHead(200); | |
| res.end('Hello!'); | |
| }); | |
| srv.listen(port); | |
| return srv; | |
| } | |
| function client(port) { | |
| var req = http.request({ | |
| method: 'GET', | |
| host: 'localhost', | |
| port: port, | |
| path: '/foo', | |
| headers: { | |
| Host: 'localhost' | |
| } | |
| }, function(res) { | |
| var buf = ''; | |
| res.setEncoding('utf8'); | |
| res.on('end', function() { | |
| console.log(buf); | |
| }); | |
| res.on('data', function(chunk) { | |
| buf += chunk; | |
| }); | |
| }); | |
| req.end(); | |
| return req; | |
| } | |
| module.exports = { | |
| 'smoke test': function(be) { | |
| /*be(function() { | |
| assert.ok(true); | |
| });*/ | |
| server(15101); | |
| client(15101); | |
| } | |
| }; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | [36minfo -[39m socket.io started | |
| [1muncaught[0m: [31mError[0m: 'test message buffering and websocket payload' timed out | |
| at Object._onTimeout (/usr/local/lib/node/expresso/bin/expresso:781:43) | |
| at Timer.callback (timers.js:83:39) | |
| [1mFailures[0m: [31m1[0m | |
| make[1]: *** [run-tests] Ошибка 1 | |
| make: *** [test] Прерывание | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment