@badger-dao/sdk-mocks

1.23.0 • Public • Published

Badger SDK Mocks

Collection of mocks for all responses made by @badger-dao/sdk. Made to improve test coverage experience working with sdk.

Version License Service Tests semantic-release

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.

Readme

Keywords

Package Sidebar

Install

npm i @badger-dao/sdk-mocks

Weekly Downloads

1

Version

1.23.0

License

MIT

Unpacked Size

4.75 MB

Total Files

169

Last publish

Collaborators

  • badgerdao_dapp
  • badgerdao_mrbasado