algodex / algodex-sdk

Client-side JavaScript SDK for Algodex as an npm package
https://docs-sdk.algodex.com
Mozilla Public License 2.0
8 stars 2 forks source link

Issue 226 ✅ acceptance add tests for all the different order types #294

Open ericsharma opened 2 years ago

ericsharma commented 2 years ago

ℹ Overview

This PR addresses the positive teal tests for every transaction type. The new positive tests use the SDK to generate the transactions so an added benefit is increased code coverage for the SDK.

✏️ Things to note:

Make sure to set autoRun: false if your workspace is configured to automatically run tests. Because all the positive teal tests work on a single orderbook, running the tests all at once leads to complications. It doesn't matter which order you run the tests in, just make sure you are only running one at a time.

Also anything related to taker execution depends on the assumption that the orderbook is empty at the beginning of the test. Check the state of the orderbook and close out any open orders if they exist before running any taker execution test.

After extensively running the tests, every once in a while one will fail. This is the result of our backend throwing a 404 every once in a while. This does not happen frequently, but if a test does fail, it is most likely related to that issue. To address the failing test, first check the state of the orderbook and close out any open orders if they exist, then re-run the test.

📝 Related Issues

226

vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
algodex-sdk ✅ Ready (Inspect) Visit Preview Oct 19, 2022 at 2:53PM (UTC)