From adb8ee237b4600f8ba69957cc1a8e28fa628690a Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Wed, 7 Aug 2019 18:55:59 -0700 Subject: [PATCH] Use wrtc for more reliable tests --- package.json | 4 ++-- test/evict.js | 12 ++---------- test/server.js | 12 ++---------- 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index 3fc45e3..2d8d18b 100644 --- a/package.json +++ b/package.json @@ -42,11 +42,11 @@ "ws": "^7.0.0" }, "devDependencies": { - "electron-webrtc": "^0.3.0", "magnet-uri": "^5.1.3", "standard": "*", "tape": "^4.0.0", - "webtorrent-fixtures": "^1.3.0" + "webtorrent-fixtures": "^1.3.0", + "wrtc": "^0.4.1" }, "engines": { "node": ">=10" diff --git a/test/evict.js b/test/evict.js index 605b03b..3cab3a7 100644 --- a/test/evict.js +++ b/test/evict.js @@ -1,9 +1,7 @@ var Client = require('../') var common = require('./common') var test = require('tape') -var electronWebrtc = require('electron-webrtc') - -var wrtc +var wrtc = require('wrtc') var infoHash = '4cb67059ed6bd08362da625b3ae77f6f4a075705' var peerId = Buffer.from('01234567890123456789') @@ -115,11 +113,5 @@ test('evict: udp server', function (t) { }) test('evict: ws server', function (t) { - wrtc = electronWebrtc() - wrtc.electronDaemon.once('ready', function () { - serverTest(t, 'ws', 'inet') - }) - t.once('end', function () { - wrtc.close() - }) + serverTest(t, 'ws', 'inet') }) diff --git a/test/server.js b/test/server.js index 1c611bc..ae3d956 100644 --- a/test/server.js +++ b/test/server.js @@ -1,9 +1,7 @@ var Client = require('../') var common = require('./common') var test = require('tape') -var electronWebrtc = require('electron-webrtc') - -var wrtc +var wrtc = require('wrtc') var infoHash = '4cb67059ed6bd08362da625b3ae77f6f4a075705' var peerId = Buffer.from('01234567890123456789') @@ -180,11 +178,5 @@ test('udp server', function (t) { }) test('ws server', function (t) { - wrtc = electronWebrtc() - wrtc.electronDaemon.once('ready', function () { - serverTest(t, 'ws', 'inet') - }) - t.once('end', function () { - wrtc.close() - }) + serverTest(t, 'ws', 'inet') })