@badger-dao/sdk-mocks
v1.23.0
Published
Badger SDK Mocks collection
Downloads
196
Readme
Badger SDK Mocks
Collection of mocks for all responses made by @badger-dao/sdk. Made to improve test coverage experience working with sdk.
Mock Files
All resp packed into .json
files, with such pattern:
@badger-dao/sdk-mocks/generated/<network>/<service>/<method>.json
For example: @badger-dao/sdk-mocks/generated/ethereum/graph/loadSett.json
Development
This package would launch and refetch methods resp only in case theire content was changed. Also, pre-commit hook will remind u, if u forget to provide method's args to chain cfg.
How to add Service?
Services are listed in enum. Just drop it there
./mocks.pkg/src/enums/sdk.services.enum.ts
How to add method?
All method and args with which they will be called are kept in configs
./mocks.pkg/src/config/<chain>.config.ts
Ignoring methods global or chain specific
To exlude service method from querying and parsing globaly add it's name to the list methodsToSkip
.
./mocks.pkg/src/constants.ts
To ignore a method on a specific chain, provide ignore: true
as value of methods object in chain methods args cfg.