<commit_before>var test = require('tape');
var quickconnect = require('..');
var roomId = require('uuid').v4();
var clients = [];

test('create test participant', function(t) {
  t.plan(1);

  clients[0] = quickconnect(location.origin);
  clients[0].once('local:announce', function() {
    t.pass('have locally announced');
  });
});

test('announce with additional profile information', function(t) {
  t.plan(3);

  clients[0].once('peer:announce', function(data) {
    t.equal(data.name, 'Bob', 'client:0 got name data');
  });

  clients[1] = quickconnect(location.origin).profile({ name: 'Bob' });
  clients[1].once('local:announce', function(data) {
    t.equal(data.name, 'Bob', 'name included in local announce');
  });

  clients[1].once('peer:announce', function(data) {
    t.pass('client:1 received reciprocated announce');
  });
});

test('create additional client', function(t) {
  t.plan(3);

  clients[0].once('peer:announce', function(data) {
    t.equal(data.name, 'Fred', 'client:0 got new client (Fred)');
  });

  clients[1].once('peer:announce', function(data) {
    t.equal(data.name, 'Fred', 'client:1 got new client (Fred)');
  });

  clients[2] = quickconnect(location.origin).profile({ name: 'Fred' });
  clients[2].once('local:announce', function() {
    t.pass('have locally announced');
  });<commit_msg>Specify room rather than relying on browser hash room sync<commit_after>var test = require('tape');
var quickconnect = require('..');
var roomId = require('uuid').v4();
var clients = [];

test('create test participant', function(t) {
  t.plan(1);

  clients[0] = quickconnect(location.origin, { room: roomId });
  clients[0].once('local:announce', function() {
    t.pass('have locally announced');
  });
});

test('announce with additional profile information', function(t) {
  t.plan(3);

  clients[0].once('peer:announce', function(data) {
    t.equal(data.name, 'Bob', 'client:0 got name data');
  });

  clients[1] = quickconnect(location.origin, { room: roomId }).profile({ name: 'Bob' });
  clients[1].once('local:announce', function(data) {
    t.equal(data.name, 'Bob', 'name included in local announce');
  });

  clients[1].once('peer:announce', function(data) {
    t.pass('client:1 received reciprocated announce');
  });
});

test('create additional client', function(t) {
  t.plan(3);

  clients[0].once('peer:announce', function(data) {
    t.equal(data.name, 'Fred', 'client:0 got new client (Fred)');
  });

  clients[1].once('peer:announce', function(data) {
    t.equal(data.name, 'Fred', 'client:1 got new client (Fred)');
  });

  clients[2] = quickconnect(location.origin, { room: roomId }).profile({ name: 'Fred' });
  clients[2].once('local:announce', function() {
    t.pass('have locally announced');
  });
{'fraction_non_alphanumeric': 0.2023852547885797, 'fraction_numerical': 0.013010480664980123, 'mean_word_length': 4.889361702127659, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7610981', 'n_tokens_mistral': 934, 'n_tokens_neox': 920, 'n_words': 195}