utxostack / rgbpp-sdk

Utilities for Bitcoin and RGB++ asset integration
ISC License
53 stars 16 forks source link

Refactor tests of service/btc lib with vitest mocks #239

Open ShookLyngs opened 3 months ago

ShookLyngs commented 3 months ago

The current tests for the service and btc libs are highly dependent on networking conditions (e.g., BtcAssetsApi service status, blockchain status, internet connectivity), which could lead to unexpected results when, for example, the client's internet connection is unstable.

To improve, we can refactor the tests with the mocking feature provided by vitest: https://vitest.dev/guide/mocking