Skip to content

Commit

Permalink
Merge branch 'main' into 9-heliaverified-fetch-http-range-request-sup…
Browse files Browse the repository at this point in the history
…port
  • Loading branch information
SgtPooki committed Mar 15, 2024
2 parents acdd632 + 01261fe commit b48c672
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions packages/verified-fetch/test/utils/parse-url-string.spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { matchPeerId } from '@libp2p/interface-compliance-tests/matchers'
import { defaultLogger } from '@libp2p/logger'
import { createEd25519PeerId } from '@libp2p/peer-id-factory'
import { type Answer } from '@multiformats/dns'
import { expect } from 'aegir/chai'
import { type IPNSRecord } from 'ipns'
import { CID } from 'multiformats/cid'
import { match } from 'sinon'
import { stubInterface } from 'sinon-ts'
import { parseUrlString } from '../../src/utils/parse-url-string.js'
import type { IPNS } from '@helia/ipns'
import type { ComponentLogger, PeerId } from '@libp2p/interface'
import type { Answer } from '@multiformats/dns'
import type { IPNSRecordV2 } from 'ipns'
import type { StubbedInstance } from 'sinon-ts'

const HTTP_PROTOCOLS = [
Expand Down Expand Up @@ -441,7 +441,7 @@ describe('parseUrlString', () => {
ipns.resolve.withArgs(matchPeerId(testPeerId)).resolves({
cid: CID.parse('QmQJ8fxavY54CUsxMSx9aE9Rdcmvhx8awJK2jzJp4iAqCr'),
path: '',
record: stubInterface<IPNSRecordV2>()
record: stubInterface<IPNSRecord>()
})

await assertMatchUrl(
Expand All @@ -458,7 +458,7 @@ describe('parseUrlString', () => {
ipns.resolve.withArgs(matchPeerId(testPeerId)).resolves({
cid: CID.parse('QmQJ8fxavY54CUsxMSx9aE9Rdcmvhx8awJK2jzJp4iAqCr'),
path: '',
record: stubInterface<IPNSRecordV2>()
record: stubInterface<IPNSRecord>()
})

await assertMatchUrl(
Expand All @@ -475,7 +475,7 @@ describe('parseUrlString', () => {
ipns.resolve.withArgs(matchPeerId(testPeerId)).resolves({
cid: CID.parse('QmQJ8fxavY54CUsxMSx9aE9Rdcmvhx8awJK2jzJp4iAqCr'),
path: '',
record: stubInterface<IPNSRecordV2>()
record: stubInterface<IPNSRecord>()
})

await assertMatchUrl(
Expand All @@ -492,7 +492,7 @@ describe('parseUrlString', () => {
ipns.resolve.withArgs(matchPeerId(testPeerId)).resolves({
cid: CID.parse('QmQJ8fxavY54CUsxMSx9aE9Rdcmvhx8awJK2jzJp4iAqCr'),
path: '',
record: stubInterface<IPNSRecordV2>()
record: stubInterface<IPNSRecord>()
})

await assertMatchUrl(
Expand All @@ -511,7 +511,7 @@ describe('parseUrlString', () => {
ipns.resolve.withArgs(matchPeerId(testPeerId)).resolves({
cid: CID.parse('QmQJ8fxavY54CUsxMSx9aE9Rdcmvhx8awJK2jzJp4iAqCr'),
path: '',
record: stubInterface<IPNSRecordV2>()
record: stubInterface<IPNSRecord>()
})

await assertMatchUrl(
Expand All @@ -535,7 +535,7 @@ describe('parseUrlString', () => {
ipns.resolve.withArgs(matchPeerId(peerId)).resolves({
cid,
path: recordPath,
record: stubInterface<IPNSRecordV2>()
record: stubInterface<IPNSRecord>()
})

await assertMatchUrl(
Expand All @@ -557,7 +557,7 @@ describe('parseUrlString', () => {
ipns.resolve.withArgs(matchPeerId(peerId)).resolves({
cid,
path: recordPath,
record: stubInterface<IPNSRecordV2>()
record: stubInterface<IPNSRecord>()
})

await assertMatchUrl(
Expand All @@ -579,7 +579,7 @@ describe('parseUrlString', () => {
ipns.resolve.withArgs(matchPeerId(peerId)).resolves({
cid,
path: recordPath,
record: stubInterface<IPNSRecordV2>()
record: stubInterface<IPNSRecord>()
})

await assertMatchUrl(
Expand All @@ -603,7 +603,7 @@ describe('parseUrlString', () => {
ipns.resolve.withArgs(matchPeerId(peerId)).resolves({
cid,
path: '',
record: stubInterface<IPNSRecordV2>()
record: stubInterface<IPNSRecord>()
})
})

Expand Down Expand Up @@ -691,7 +691,7 @@ describe('parseUrlString', () => {
ipns.resolve.withArgs(matchPeerId(peerId)).resolves({
cid,
path: '',
record: stubInterface<IPNSRecordV2>()
record: stubInterface<IPNSRecord>()
})
})

Expand Down Expand Up @@ -793,7 +793,7 @@ describe('parseUrlString', () => {
ipns.resolve.withArgs(matchPeerId(value as PeerId)).resolves({
cid,
path: '',
record: stubInterface<IPNSRecordV2>()
record: stubInterface<IPNSRecord>()
})
} else if (type === 'dnslink-encoded') {
const matchValue = (value as string).replace(/-/g, '.')
Expand Down

0 comments on commit b48c672

Please sign in to comment.