test.filename.js 510 B

1234567891011121314151617181920212223242526
  1. /**
  2. * Module dependencies.
  3. */
  4. var cluster = require('../')
  5. , http = require('http');
  6. require('./common');
  7. cluster = cluster('support/exported')
  8. .set('workers', 4)
  9. .listen(3000);
  10. cluster.on('listening', function(){
  11. process.cwd().should.include.string('cluster/test');
  12. http.get({ host: 'localhost', port: 3000 }, function(res){
  13. res.on('data', function(chunk){
  14. chunk.toString().should.equal('Hello World');
  15. });
  16. res.on('end', function(){
  17. cluster.close();
  18. });
  19. });
  20. });