@libp2p/interop 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,44 +9,52 @@
9
9
 
10
10
  This repository will be used for interop tests.
11
11
 
12
- ## Lead Maintainer
13
-
14
- [Vasco Santos](https://github.com/vasco-santos)
15
-
16
12
  ## Usage
17
13
 
18
14
  ### Install
19
15
 
20
16
  ```
21
- > git clone git@github.com:libp2p/interop.git
22
- > cd interop
23
- > npm install
17
+ > npm install @libp2p/interop
24
18
  ```
25
19
 
26
- ### Run the tests
20
+ ### Running the tests
27
21
 
28
- ```
29
- > npm test
30
- ```
22
+ Create a js file that configures the different types of daemon:
31
23
 
32
- #### Testing local daemons
24
+ ```js
25
+ import { interopTests } from '@libp2p/interop'
26
+ import type { Daemon, DaemonFactory } from '@libp2p/interop'
33
27
 
34
- It is possible to test local versions of the go and js daemons exporting the respective path before running the tests.
28
+ async function createGoPeer (options: SpawnOptions): Promise<Daemon> {
29
+ // your implementation here
30
+ }
35
31
 
36
- **Specifying the go-libp2p daemon**
37
- See the go-libp2p-daemon [install instructions](https://github.com/libp2p/go-libp2p-daemon#install) for building the local binary.
32
+ async function createJsPeer (options: SpawnOptions): Promise<Daemon> {
33
+ // your implementation here
34
+ }
38
35
 
39
- ```sh
40
- $ LIBP2P_GO_BIN=$GOPATH/bin/p2pd npm run test
41
- ```
36
+ async function main () {
37
+ const factory: DaemonFactory = {
38
+ async spawn (options: SpawnOptions) {
39
+ if (options.type === 'go') {
40
+ return createGoPeer(options)
41
+ }
42
+
43
+ return createJsPeer(options)
44
+ }
45
+ }
42
46
 
43
- **Specifying the js-libp2p daemon**
44
- From the js-libp2p-daemon local repo checkout you can perform an `npm link` to create a binary, `jsp2pd` in the global npm space.
47
+ interopTests(factory)
48
+ }
45
49
 
46
- ```sh
47
- $ LIBP2P_JS_BIN=$(which jsp2pd) npm run test
50
+ main().catch(err => {
51
+ console.error(err)
52
+ process.exit(1)
53
+ })
48
54
  ```
49
55
 
56
+ For an example, see the js-libp2p interop test runner.
57
+
50
58
  ## Contribute
51
59
 
52
60
  Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/ipfs-interop/issues)!
@@ -57,4 +65,7 @@ This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/c
57
65
 
58
66
  ## License
59
67
 
60
- MIT
68
+ Licensed under either of
69
+
70
+ * Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / http://www.apache.org/licenses/LICENSE-2.0)
71
+ * MIT ([LICENSE-MIT](LICENSE-MIT) / http://opensource.org/licenses/MIT)
@@ -16,5 +16,5 @@ export interface SpawnOptions {
16
16
  export interface DaemonFactory {
17
17
  spawn: (options: SpawnOptions) => Promise<Daemon>;
18
18
  }
19
- export default function interopTests(factory: DaemonFactory): Promise<void>;
19
+ export declare function interopTests(factory: DaemonFactory): Promise<void>;
20
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IACzB,MAAM,EAAE,YAAY,CAAA;CACrB;AAED,oBAAY,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAA;AAClC,oBAAY,UAAU,GAAG,KAAK,GAAG,SAAS,GAAG,WAAW,CAAA;AAExD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,QAAQ,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,IAAI,CAAA;IACZ,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,YAAY,CAAC,EAAE,WAAW,GAAG,UAAU,CAAA;CACxC;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;CAClD;AAED,wBAA8B,YAAY,CAAE,OAAO,EAAE,aAAa,iBAIjE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IACzB,MAAM,EAAE,YAAY,CAAA;CACrB;AAED,oBAAY,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAA;AAClC,oBAAY,UAAU,GAAG,KAAK,GAAG,SAAS,GAAG,WAAW,CAAA;AAExD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,QAAQ,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,IAAI,CAAA;IACZ,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,YAAY,CAAC,EAAE,WAAW,GAAG,UAAU,CAAA;CACxC;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;CAClD;AAED,wBAAsB,YAAY,CAAE,OAAO,EAAE,aAAa,iBAIzD"}
package/dist/src/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { connectTests } from './connect.js';
2
2
  import { dhtTests } from './dht/index.js';
3
3
  import { pubsubTests } from './pubsub/index.js';
4
- export default async function interopTests(factory) {
4
+ export async function interopTests(factory) {
5
5
  await connectTests(factory);
6
6
  await dhtTests(factory);
7
7
  await pubsubTests(factory);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAwB/C,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,YAAY,CAAE,OAAsB;IAChE,MAAM,YAAY,CAAC,OAAO,CAAC,CAAA;IAC3B,MAAM,QAAQ,CAAC,OAAO,CAAC,CAAA;IACvB,MAAM,WAAW,CAAC,OAAO,CAAC,CAAA;AAC5B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAwB/C,MAAM,CAAC,KAAK,UAAU,YAAY,CAAE,OAAsB;IACxD,MAAM,YAAY,CAAC,OAAO,CAAC,CAAA;IAC3B,MAAM,QAAQ,CAAC,OAAO,CAAC,CAAA;IACvB,MAAM,WAAW,CAAC,OAAO,CAAC,CAAA;AAC5B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libp2p/interop",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Interoperability Tests for libp2p",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "homepage": "https://github.com/libp2p/interop#readme",