-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove stubs from verified-fetch tests (#431)
The extensive stubbing in the `@helia/verified-fetch` tests have some baked-in assumptions about how the codecs work which are not easy to unpick. It's quick to test using the actual codecs if the block data is already present so remove the stubs and use a network-less Helia node to make the tests more reliable.
- Loading branch information
1 parent
9b1ddf8
commit 75d0a5b
Showing
4 changed files
with
188 additions
and
280 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
packages/verified-fetch/test/fixtures/create-offline-helia.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Helia as HeliaClass } from '@helia/utils' | ||
import { MemoryBlockstore } from 'blockstore-core' | ||
import { MemoryDatastore } from 'datastore-core' | ||
import type { Helia } from '@helia/interface' | ||
|
||
export async function createHelia (): Promise<Helia> { | ||
const datastore = new MemoryDatastore() | ||
const blockstore = new MemoryBlockstore() | ||
|
||
const helia = new HeliaClass({ | ||
datastore, | ||
blockstore, | ||
blockBrokers: [], | ||
routers: [] | ||
}) | ||
|
||
await helia.start() | ||
|
||
return helia | ||
} |
Oops, something went wrong.