<commit_before>var test = require('tape');
var detect = require('../detect.js');
var normalize = require('../normalize-ice');
var RTCPeerConnection;

var stunFormatA = [
  { url: 'stun:stun.l.google.com:19302' }
];

var turnFormatA = [
  { url: 'turn:tmp@hoth.rtc.io:3478' }
];

test('can detect an RTCPeerConnection constructor', function(t) {
  t.plan(1);
  t.ok(RTCPeerConnection = detect('RTCPeerConnection'));
});

test('can create a connection with a single stun server', function(t) {
  var config;
  var pc;

  t.plan(2);
  t.ok(config = { iceServers: [ stunFormatA[0] ].map(normalize) }, 'created config');
  t.ok(pc = new RTCPeerConnection(config), 'created pc');
});

test('can create a connection with a single turn server', function(t) {
  var config;
  var pc;

  t.plan(2);
  t.ok(config = { iceServers: [ turnFormatA[0] ].map(normalize) }, 'created config');
  t.ok(pc = new RTCPeerConnection(config), 'created pc');
});<commit_msg>Expanded tests<commit_after>var test = require('tape');
var detect = require('../detect.js');
var normalize = require('../normalize-ice');
var RTCPeerConnection;

var stunFormatA = [
  { url: 'stun:stun.l.google.com:19302' }
];

var turnFormatA = [
  { url: 'turn:tmp:test@hoth.rtc.io:3478' },
  { url: 'turn:tmp:test@hoth.rtc.io' }
];

test('can detect an RTCPeerConnection constructor', function(t) {
  t.plan(1);
  t.ok(RTCPeerConnection = detect('RTCPeerConnection'));
});

test('can create a connection with a single stun server', function(t) {
  var config;
  var pc;

  t.plan(2);
  t.ok(config = { iceServers: [ stunFormatA[0] ].map(normalize) }, 'created config');
  t.ok(pc = new RTCPeerConnection(config), 'created pc');
});

test('can create a connection with a single turn server', function(t) {
  var config;
  var pc;

  t.plan(2);
  t.ok(config = { iceServers: [ turnFormatA[0] ].map(normalize) }, 'created config');
  t.ok(pc = new RTCPeerConnection(config), 'created pc');
});

test('can create a connection with a single turn server (no port)', function(t) {
  var config;
  var pc;

  t.plan(2);
  t.ok(config = { iceServers: [ turnFormatA[1] ].map(normalize) }, 'created config');
  t.ok(pc = new RTCPeerConnection(config), 'created pc');
});

test('can create a connection with multiple turn servers', function(t) {
  var config;
  var pc;

  t.plan(2);
  t.ok(config = { iceServers: turnFormatA.map(normalize) }, 'created config');
  t.ok(pc = new RTCPeerConnection(config), 'created pc');
});
{'fraction_non_alphanumeric': 0.17694805194805194, 'fraction_numerical': 0.012581168831168832, 'mean_word_length': 4.5895691609977325, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 3, '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': '882117', 'n_tokens_mistral': 916, 'n_tokens_neox': 883, 'n_words': 215}