Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test/node
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2016-01-02 16:26:14 +0300
committerFeross Aboukhadijeh <feross@feross.org>2016-01-02 16:26:14 +0300
commit0130530ca338b8329983fd2ac766a0a7b556c94f (patch)
tree3f141ce69a8a430bdc968ed5012bf0bf5243a22f /test/node
parente36e0d50909e698e31633a584bf1792b3bc523cf (diff)
New API: WebTorrent.WEBRTC_SUPPORT
Detect native WebRTC support in the environment. ```js if (WebTorrent.WEBRTC_SUPPORT) { // webrtc support! } else { // fallback } ```
Diffstat (limited to 'test/node')
-rw-r--r--test/node/basic.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/node/basic.js b/test/node/basic.js
index b225b8d..6bee61c 100644
--- a/test/node/basic.js
+++ b/test/node/basic.js
@@ -3,6 +3,21 @@ var http = require('http')
var test = require('tape')
var WebTorrent = require('../../')
+test('WebTorrent.WEBRTC_SUPPORT', function (t) {
+ t.plan(2)
+
+ var client = new WebTorrent({ dht: false, tracker: false })
+
+ client.on('error', function (err) { t.fail(err) })
+ client.on('warning', function (err) { t.fail(err) })
+
+ t.equal(WebTorrent.WEBRTC_SUPPORT, false)
+
+ client.destroy(function (err) {
+ t.error(err, 'client destroyed')
+ })
+})
+
test('client.add: http url to a torrent file, string', function (t) {
t.plan(8)