mirror of
https://github.com/fluencelabs/js-mafmt
synced 2025-04-25 15:12:21 +00:00
test: adding tests for bad circuit addresses
This commit is contained in:
parent
c80fb350a9
commit
40f8c9f64b
@ -107,6 +107,14 @@ describe('multiaddr validation', function () {
|
|||||||
'p2p-circuit/ipfs/QmUjNmr8TgJCn1Ao7DvMy4cjoZU15b9bwSCBLE3vwXiwgj'
|
'p2p-circuit/ipfs/QmUjNmr8TgJCn1Ao7DvMy4cjoZU15b9bwSCBLE3vwXiwgj'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
const badCircuit = [
|
||||||
|
'/ip4/0.0.0.0/tcp/12345/udp/2222/wss',
|
||||||
|
'/ip4/0.0.7.6/udp/1234',
|
||||||
|
'/ip6/::/udp/0/utp',
|
||||||
|
'/dns/ipfs.io/ws',
|
||||||
|
'/libp2p-webrtc-direct/ip4/1.2.3.4/tcp/3456/http'
|
||||||
|
]
|
||||||
|
|
||||||
const goodIPFS = [
|
const goodIPFS = [
|
||||||
'/ip4/127.0.0.1/tcp/20008/ws/ipfs/QmUjNmr8TgJCn1Ao7DvMy4cjoZU15b9bwSCBLE3vwXiwgj',
|
'/ip4/127.0.0.1/tcp/20008/ws/ipfs/QmUjNmr8TgJCn1Ao7DvMy4cjoZU15b9bwSCBLE3vwXiwgj',
|
||||||
'/libp2p-webrtc-star/ip4/1.2.3.4/tcp/3456/ws/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSoooo4',
|
'/libp2p-webrtc-star/ip4/1.2.3.4/tcp/3456/ws/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSoooo4',
|
||||||
@ -185,6 +193,7 @@ describe('multiaddr validation', function () {
|
|||||||
|
|
||||||
it('Circuit validation', function () {
|
it('Circuit validation', function () {
|
||||||
assertMatches(mafmt.Circuit, goodCircuit)
|
assertMatches(mafmt.Circuit, goodCircuit)
|
||||||
|
assertMismatches(mafmt.Circuit, badCircuit)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('IPFS validation', function () {
|
it('IPFS validation', function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user