index.js 294 B

1234567891011121314151617
  1. var thread = require('..');
  2. var co = require('co');
  3. describe('thread(fn, n)', function(){
  4. it('should spawn multiple generators', function(done){
  5. var n = 0;
  6. co(function *(){
  7. yield thread(function *(){
  8. ++n;
  9. }, 50);
  10. n.should.equal(50);
  11. })(done);
  12. })
  13. })