Skip to content

Commit a06f64b

Browse files
authored
chore: stub blocks interface in tests (#418)
The stub should be for the `Blocks` interface.
1 parent e6d41a0 commit a06f64b

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@
168168
"@types/sinon": "^17.0.2",
169169
"aegir": "^42.1.0",
170170
"helia": "^4.0.1",
171-
"interface-blockstore": "^5.2.9",
172171
"sinon": "^17.0.1",
173172
"sinon-ts": "^2.0.0"
174173
},

test/verified-fetch.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import sinon, { type SinonStub } from 'sinon'
1212
import { stubInterface } from 'sinon-ts'
1313
import { VerifiedFetch } from '../src/verified-fetch.js'
1414
import type { PathWalkerFn } from '../src/utils/walk-path'
15-
import type { Helia } from '@helia/interface'
15+
import type { Blocks, Helia } from '@helia/interface'
1616
import type { Logger, ComponentLogger } from '@libp2p/interface'
17-
import type { Blockstore } from 'interface-blockstore'
1817
import type { UnixFSDirectory, UnixFSEntry } from 'ipfs-unixfs-exporter'
18+
1919
const testCID = CID.parse('QmQJ8fxavY54CUsxMSx9aE9Rdcmvhx8awJK2jzJp4iAqCr')
2020
const anyOnProgressMatcher = sinon.match.any as unknown as () => void
2121

@@ -102,10 +102,10 @@ describe('@helia/verifed-fetch', () => {
102102
let jsonStub: ReturnType<typeof stubInterface<HeliaJSON>>
103103
let dagCborStub: ReturnType<typeof stubInterface<DAGCBOR>>
104104
let pathWalkerStub: SinonStub<Parameters<PathWalkerFn>, ReturnType<PathWalkerFn>>
105-
let blockstoreStub: ReturnType<typeof stubInterface<Blockstore>>
105+
let blockstoreStub: ReturnType<typeof stubInterface<Blocks>>
106106

107107
beforeEach(async () => {
108-
blockstoreStub = stubInterface<Blockstore>()
108+
blockstoreStub = stubInterface<Blocks>()
109109
unixfsStub = stubInterface<UnixFS>({
110110
cat: sinon.stub(),
111111
stat: sinon.stub()

0 commit comments

Comments
 (0)