package
airtap for pairwise interoperability testing.
npm install twintapGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
airtap for pairwise interoperability testing. Designed for WebRTC compatibility testing.
npm install -g twintapWrite tests like tape, except use twintap/tape and pass an array of two test functions.
const test = require('twintap/tape')
test('test name', [
(t) => {
// test A-side of connection
t.pass()
t.end()
},
(t) => {
// test B-side of connection
t.pass()
t.end()
}])Setup a .twintap.yml or .airtap.yml.
Run your tests:
In Saucelabs: twintap test/*.js
With local browsers: twintap --local test/*.js
The sync server allows synchronizing peers with simple barriers.
test('test name', [
async (t) => {
// test WebRTC, Websockets, etc
await t.barrier('first barrier') // will not resolve until all peers have reached this point
t.send('A', 'test data') // send events
t.end()
},
async (t) => {
// test WebRTC, Websockets, etc
await t.barrier('first barrier') // will not resolve untill all peers have reached this point
t.receive('A', (data) => {
t.end()
})
}
])A barrier is automatically inserted before each test to ensure tests do not overlap.
If both sides of the test are identical, just pass one function instead of duplicating code.
test('test name',
async (t) => {
// test WebRTC, Websockets, etc
await t.barrier('first barrier') // will not resolve until all peers have reached this point
t.send('A', 'test data') // send events
t.end()
})twintap/tape exposes all the features of tape, plus...
await t.barrier(name, [timeout])Wait until the other peer has also reached this barrier.
name is a string unique to the test case.timeout is the time to wait in milliseconds. Defaults to 30000.t.send(eventName, [data])Send an event with serializable data to the other peer.
eventName is the name of the event for the other peer to listen to.data is any serializable data to send.t.receive(eventName, (data) => {})Wait for an event from the other peer. Callback is passed any deserialized data sent.
eventName is the name of the even to wait for.t.instance0 or 1 depending on which side the test is running on. Useful for tests that are nearly symmetrical.
twintap suports SauceLabs, just like airtap. It requires Sauce Connect.
./sc -u <SAUCE_USERNAME> -k <SAUCE_KEY> --no-ssl-bump-domains airtap.localEstimated unpacked size across 64 packages.
17.3 MB+
Includes dependencies.
4.18.1
~0.5.1
3.0.1
~1.5.0
1.5.2
^3.0.0
4.2.0
~0.3.0
0.3.0
~4.17.0
5.3.0
~3.11.0
4.0.0
~3.0.0
15.1.0
~16.5.0
17.0.1
~1.17.0
1.18.1
~5.4.0
18.3.4
~1.19.0
2.4.0
~1.7.1
1.8.2
~1.0.0
2.0.0
~1.7.0
1.12.0
~9.12.0
11.12.0
~0.2.2
0.2.2
~0.0.1
0.0.1
~1.4.0
2.0.0
~2.0.0
2.0.2
~1.0.0
1.0.0
~2.0.0
3.0.0
~1.0.1
1.0.1
~1.2.0
4.7.1
^8.1.1
9.1.0
~1.1.0
1.1.0
~3.21.0
3.35.1
~1.6.0
2.0.0
~3.0.1
3.0.1