Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
fix(tests): detect correctly support
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Jan 17, 2017
1 parent 50fa9a6 commit 2818dd2
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
7 changes: 6 additions & 1 deletion test/transport/dial.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@

'use strict'

const webrtcSupport = require('webrtcsupport')
const expect = require('chai').expect
const multiaddr = require('multiaddr')
const series = require('async/series')
const pull = require('pull-stream')

const WebRTCStar = require('../../src')
const isNode = require('detect-node')

describe('dial', () => {
if (!webrtcSupport.support && !isNode) {
return console.log('WebRTC not available')
}

let ws1
const ma1 = multiaddr('/libp2p-webrtc-star/ip4/127.0.0.1/tcp/15555/ws/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSooo2a')
// deployed sig server
Expand Down
7 changes: 6 additions & 1 deletion test/transport/discovery.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@

const expect = require('chai').expect
const multiaddr = require('multiaddr')

const webrtcSupport = require('webrtcsupport')
const isNode = require('detect-node')
const WebRTCStar = require('../../src')

describe('peer discovery', () => {
if (!webrtcSupport.support && !isNode) {
return console.log('WebRTC not available')
}

let ws1
const ma1 = multiaddr('/libp2p-webrtc-star/ip4/127.0.0.1/tcp/15555/ws/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSooo3A')

Expand Down
6 changes: 6 additions & 0 deletions test/transport/listen.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@
const expect = require('chai').expect
const multiaddr = require('multiaddr')
const WebRTCStar = require('../../src')
const webrtcSupport = require('webrtcsupport')
const isNode = require('detect-node')

describe('listen', () => {
if (!webrtcSupport.support && !isNode) {
return console.log('WebRTC not available')
}

let ws

const ma = multiaddr('/libp2p-webrtc-star/ip4/127.0.0.1/tcp/15555/ws/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSooooA')
Expand Down
6 changes: 6 additions & 0 deletions test/transport/valid-connection.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@ const expect = require('chai').expect
const multiaddr = require('multiaddr')
const series = require('async/series')
const pull = require('pull-stream')
const webrtcSupport = require('webrtcsupport')
const isNode = require('detect-node')

const WebRTCStar = require('../../src')

describe('valid Connection', () => {
if (!webrtcSupport.support && !isNode) {
return console.log('WebRTC not available')
}

let ws1
const ma1 = multiaddr('/libp2p-webrtc-star/ip4/127.0.0.1/tcp/15555/ws/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSooo5a')

Expand Down

0 comments on commit 2818dd2

Please sign in to comment.