{"id":16889859,"url":"https://github.com/t-mullen/twintap","last_synced_at":"2026-04-14T06:33:20.233Z","repository":{"id":137583789,"uuid":"228090074","full_name":"t-mullen/twintap","owner":"t-mullen","description":"airtap for pairwise interoperability testing","archived":false,"fork":false,"pushed_at":"2020-09-10T23:28:37.000Z","size":86,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-10T18:17:57.166Z","etag":null,"topics":["tape","testing","webrtc"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/t-mullen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-14T21:16:50.000Z","updated_at":"2019-12-17T08:51:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"99b5f8b7-4a1d-4f65-bb8c-2d3dedfcf82e","html_url":"https://github.com/t-mullen/twintap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/t-mullen/twintap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t-mullen%2Ftwintap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t-mullen%2Ftwintap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t-mullen%2Ftwintap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t-mullen%2Ftwintap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/t-mullen","download_url":"https://codeload.github.com/t-mullen/twintap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t-mullen%2Ftwintap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31785677,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["tape","testing","webrtc"],"created_at":"2024-10-13T16:59:25.889Z","updated_at":"2026-04-14T06:33:20.188Z","avatar_url":"https://github.com/t-mullen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# twintap\n\n[`airtap`](https://github.com/airtap/airtap) for pairwise interoperability testing. Designed for WebRTC compatibility testing.\n\n## Install\n```\nnpm install -g twintap\n```\n\n## Usage\n\nWrite tests like [`tape`](https://github.com/substack/tape), except use `twintap/tape` and pass an array of two test functions.\n```javascript\nconst test = require('twintap/tape')\ntest('test name', [\n  (t) =\u003e {\n    // test A-side of connection\n    t.pass()\n    t.end()\n  },\n  (t) =\u003e {\n    // test B-side of connection\n    t.pass()\n    t.end()\n}])\n```\n\nSetup a `.twintap.yml` or `.airtap.yml`.\n\nRun your tests:\nIn Saucelabs: `twintap test/*.js`\nWith local browsers: `twintap --local test/*.js`\n\n## Synchronization\nThe sync server allows synchronizing peers with simple barriers. \n\n```javascript\ntest('test name', [\n  async (t) =\u003e {\n    // test WebRTC, Websockets, etc\n    await t.barrier('first barrier') // will not resolve until all peers have reached this point\n    t.send('A', 'test data') // send events\n    t.end()\n  },\n  async (t) =\u003e {\n    // test WebRTC, Websockets, etc\n    await t.barrier('first barrier') // will not resolve untill all peers have reached this point\n    t.receive('A', (data) =\u003e {\n          t.end()\n    })\n  }\n])\n```\n\nA barrier is automatically inserted before each test to ensure tests do not overlap.\n\n## Symmetrical Tests\nIf both sides of the test are identical, just pass one function instead of duplicating code.\n```javascript\ntest('test name', \n  async (t) =\u003e {\n    // test WebRTC, Websockets, etc\n    await t.barrier('first barrier') // will not resolve until all peers have reached this point\n    t.send('A', 'test data') // send events\n    t.end()\n })\n```\n\n## API\n`twintap/tape` exposes all the features of `tape`, plus...\n\n### `await t.barrier(name, [timeout])`\nWait until the other peer has also reached this barrier.\n\n- `name` is a string unique to the test case.\n- Optional `timeout` is the time to wait in milliseconds. Defaults to `30000`.\n\n### `t.send(eventName, [data])`\nSend an event with serializable data to the other peer.\n\n- `eventName` is the name of the event for the other peer to listen to.\n- Optional `data` is any serializable data to send.\n\n### `t.receive(eventName, (data) =\u003e {})`\nWait for an event from the other peer. Callback is passed any deserialized data sent.\n\n- `eventName` is the name of the even to wait for.\n\n### `t.instance`\n`0` or `1` depending on which side the test is running on. Useful for tests that are nearly symmetrical.\n\n## Saucelabs\n`twintap` suports [SauceLabs](https://saucelabs.com/), just like `airtap`. It requires [Sauce Connect](https://wiki.saucelabs.com/display/DOCS/Basic+Sauce+Connect+Proxy+Setup).\n\n```\n./sc -u \u003cSAUCE_USERNAME\u003e -k \u003cSAUCE_KEY\u003e --no-ssl-bump-domains airtap.local\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft-mullen%2Ftwintap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ft-mullen%2Ftwintap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft-mullen%2Ftwintap/lists"}