<commit_before>var test = require('tape');
var signaller = require('..');
var uuid = require('cuid');
var signallers = [];
var roomId = uuid();
var signallingServer = require('./helpers/signalling-server');
var times = require('whisk/times');
var pluck = require('whisk/pluck');

test('create signallers', function(t) {
  signallers = times(50).map(function() {
    return signaller(signallingServer);
  });

  t.plan(signallers.length);
  signallers.forEach(function(sig, idx) {
    sig.once('connected', t.pass.bind(t, 'signaller ' + idx + ' connected'));
  });
});
<commit_msg>Connect each socket one after the other so firefox does not freak out<commit_after>var test = require('tape');
var signaller = require('..');
var uuid = require('cuid');
var signallers = [];
var roomId = uuid();
var signallingServer = require('./helpers/signalling-server');
var signallerCount = typeof window != 'undefined' ? 10 : 100;
var times = require('whisk/times');
var pluck = require('whisk/pluck');

test('create signallers', function(t) {
  var pending;

  function connectNext() {
    var idx;
    var sig = signaller(signallingServer).once('connected', function() {
      t.pass('signaller ' + idx + ' connected');

      if (signallers.length < signallerCount) {
        connectNext();
      }
    });

    signallers[idx = signallers.length] = sig;
  }

  t.plan(signallerCount);
  connectNext();
});

{'fraction_non_alphanumeric': 0.16905444126074498, 'fraction_numerical': 0.00501432664756447, 'mean_word_length': 4.373076923076923, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1774209', 'n_tokens_mistral': 446, 'n_tokens_neox': 446, 'n_words': 105}