@libp2p/interface-compliance-tests 5.1.3-dbc92ab74 → 5.1.3-f4dda4a3c
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/dist/src/matchers.d.ts +6 -0
- package/dist/src/matchers.d.ts.map +1 -0
- package/dist/src/matchers.js +8 -0
- package/dist/src/matchers.js.map +1 -0
- package/package.json +13 -9
- package/src/matchers.ts +11 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import Sinon from 'sinon';
|
|
2
|
+
import type { PeerId } from '@libp2p/interface';
|
|
3
|
+
import type { Multiaddr } from '@multiformats/multiaddr';
|
|
4
|
+
export declare function matchPeerId(peerId: PeerId): Sinon.SinonMatcher;
|
|
5
|
+
export declare function matchMultiaddr(ma: Multiaddr): Sinon.SinonMatcher;
|
|
6
|
+
//# sourceMappingURL=matchers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matchers.d.ts","sourceRoot":"","sources":["../../src/matchers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,wBAAgB,WAAW,CAAE,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,YAAY,CAE/D;AAED,wBAAgB,cAAc,CAAE,EAAE,EAAE,SAAS,GAAG,KAAK,CAAC,YAAY,CAEjE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import Sinon from 'sinon';
|
|
2
|
+
export function matchPeerId(peerId) {
|
|
3
|
+
return Sinon.match(p => p.toString() === peerId.toString());
|
|
4
|
+
}
|
|
5
|
+
export function matchMultiaddr(ma) {
|
|
6
|
+
return Sinon.match(m => m.toString() === ma.toString());
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=matchers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matchers.js","sourceRoot":"","sources":["../../src/matchers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,UAAU,WAAW,CAAE,MAAc;IACzC,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAA;AAC7D,CAAC;AAED,MAAM,UAAU,cAAc,CAAE,EAAa;IAC3C,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAA;AACzD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/interface-compliance-tests",
|
|
3
|
-
"version": "5.1.3-
|
|
3
|
+
"version": "5.1.3-f4dda4a3c",
|
|
4
4
|
"description": "Compliance tests for JS libp2p interfaces",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/interface-compliance-tests#readme",
|
|
@@ -60,6 +60,10 @@
|
|
|
60
60
|
"types": "./dist/src/is-valid-tick.d.ts",
|
|
61
61
|
"import": "./dist/src/is-valid-tick.js"
|
|
62
62
|
},
|
|
63
|
+
"./matchers": {
|
|
64
|
+
"types": "./dist/src/matchers.d.ts",
|
|
65
|
+
"import": "./dist/src/matchers.js"
|
|
66
|
+
},
|
|
63
67
|
"./mocks": {
|
|
64
68
|
"types": "./dist/src/mocks/index.d.ts",
|
|
65
69
|
"import": "./dist/src/mocks/index.js"
|
|
@@ -107,14 +111,14 @@
|
|
|
107
111
|
"test:electron-main": "aegir test -t electron-main"
|
|
108
112
|
},
|
|
109
113
|
"dependencies": {
|
|
110
|
-
"@libp2p/interface": "1.1.2-
|
|
111
|
-
"@libp2p/interface-internal": "1.0.7-
|
|
112
|
-
"@libp2p/logger": "4.0.5-
|
|
113
|
-
"@libp2p/multistream-select": "5.1.2-
|
|
114
|
-
"@libp2p/peer-collections": "5.1.5-
|
|
115
|
-
"@libp2p/peer-id": "4.0.5-
|
|
116
|
-
"@libp2p/peer-id-factory": "4.0.5-
|
|
117
|
-
"@libp2p/utils": "5.2.2-
|
|
114
|
+
"@libp2p/interface": "1.1.2-f4dda4a3c",
|
|
115
|
+
"@libp2p/interface-internal": "1.0.7-f4dda4a3c",
|
|
116
|
+
"@libp2p/logger": "4.0.5-f4dda4a3c",
|
|
117
|
+
"@libp2p/multistream-select": "5.1.2-f4dda4a3c",
|
|
118
|
+
"@libp2p/peer-collections": "5.1.5-f4dda4a3c",
|
|
119
|
+
"@libp2p/peer-id": "4.0.5-f4dda4a3c",
|
|
120
|
+
"@libp2p/peer-id-factory": "4.0.5-f4dda4a3c",
|
|
121
|
+
"@libp2p/utils": "5.2.2-f4dda4a3c",
|
|
118
122
|
"@multiformats/multiaddr": "^12.1.10",
|
|
119
123
|
"abortable-iterator": "^5.0.1",
|
|
120
124
|
"aegir": "^42.0.0",
|
package/src/matchers.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Sinon from 'sinon'
|
|
2
|
+
import type { PeerId } from '@libp2p/interface'
|
|
3
|
+
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
4
|
+
|
|
5
|
+
export function matchPeerId (peerId: PeerId): Sinon.SinonMatcher {
|
|
6
|
+
return Sinon.match(p => p.toString() === peerId.toString())
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function matchMultiaddr (ma: Multiaddr): Sinon.SinonMatcher {
|
|
10
|
+
return Sinon.match(m => m.toString() === ma.toString())
|
|
11
|
+
}
|