IB@stoqey/ib
@stoqey/ib (Low-Level SDK)Guides & Resources

Testing & Contributing Guide

Local development setup, running Jest unit tests, code style guidelines, and contribution instructions.

Local Development Workflow

To contribute features or fix bugs in @stoqey/ib:

  1. Clone the repository:

    git clone https://github.com/stoqey/ib.git
    cd ib
  2. Install dependencies:

    yarn install
  3. Build TypeScript source:

    yarn build

Running Jest Unit & Integration Tests

Test Environment Safety

Always test on a paper trading account as unit or integration tests may submit test orders or modify open positions!

Run All Unit Tests

yarn test

Run Specific Test File

npx jest src/tests/unit/api/api.test.ts

Code Guidelines & PR Expectations

  • TypeScript Standard: Keep public API exports in src/index.ts and src/api-next/index.ts in sync.
  • Code Style: Follow existing ESLint / Prettier rules (2-space indentation, double quotes, semicolons).
  • Minimal Diffs: Keep changes focused and localized; avoid refactoring unrelated files.
  • Tests: Add unit test coverage for new methods or fixes.

On this page