You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jest does not appear anywhere in dependencies or devDependencies (only typescript and @types/node are listed) — running npm test in sdk/ fails immediately with a
"command not found" / module-resolution error.
There are no *.test.ts/*.spec.ts files anywhere under sdk/.
.github/workflows/ci.yml contains exactly one job family (check, clippy, fmt, cycle-guard, test) and every one of them is Rust/cargo-only — there is no Node.js
setup step, no npm install, no npm run build/npm test job anywhere in CI for sdk/.
The SDK (delivered under closed issue #207) is therefore entirely unverified by any automated
process: a change that breaks sdk/src/base.ts's XDR encoding, breaks the build, or introduces
a runtime bug would merge silently with a fully green CI run.
Requirements and Context
This is not "add more tests" filler — it's establishing test infrastructure that currently
does not exist at all for an entire deliverable package, and wiring it into CI so regressions
are caught automatically going forward, matching the rigor already applied to the Rust side.
Add jest, ts-jest, @types/jest to sdk/package.json's devDependencies; add a jest.config.js/ts-jest preset.
Since BaseClient.invoke() talks to a real Soroban RPC endpoint, add a mocking layer (e.g. jest.mock around @stellar/stellar-sdk's rpc.Server) so unit tests can exercise KoraClient/each *Client class's argument-encoding and response-decoding logic without a
live network — or, for deeper coverage, integrate a local Soroban sandbox / stellar-cli local network in CI and run true integration tests against deployed test contracts.
Write unit tests for each of the 7 client classes covering at minimum: correct XDR argument
construction for each method (matching the parameter counts fixed in issues Refactor Treasury Contracts #7/Optimize Financing Pool Contracts #9), and
correct decoding of a mocked simulation/transaction response back into the documented TS types.
Add a sdk job to .github/workflows/ci.yml that runs npm ci, npm run build (tsc),
and npm test inside sdk/, gating merges the same way the Rust jobs do.
Run everything locally and in CI to confirm green.
Acceptance Criteria
npm test inside sdk/ runs and passes without manual setup beyond npm install
Each of the 7 SDK client classes has at least one passing test exercising argument encoding and response decoding
.github/workflows/ci.yml contains a job that builds and tests sdk/ on every PR
A deliberately broken SDK change (e.g. wrong arg order) is demonstrated to fail the new CI job in the PR description or a linked draft commit
Guidelines: PR description must include Closes #<issue-number>. Complexity: High (200 points)
Description
sdk/package.jsondeclares"test": "jest", but:jestdoes not appear anywhere independenciesordevDependencies(onlytypescriptand@types/nodeare listed) — runningnpm testinsdk/fails immediately with a"command not found" / module-resolution error.
*.test.ts/*.spec.tsfiles anywhere undersdk/..github/workflows/ci.ymlcontains exactly one job family (check,clippy,fmt,cycle-guard,test) and every one of them is Rust/cargo-only — there is no Node.jssetup step, no
npm install, nonpm run build/npm testjob anywhere in CI forsdk/.The SDK (delivered under closed issue #207) is therefore entirely unverified by any automated
process: a change that breaks
sdk/src/base.ts's XDR encoding, breaks the build, or introducesa runtime bug would merge silently with a fully green CI run.
Requirements and Context
This is not "add more tests" filler — it's establishing test infrastructure that currently
does not exist at all for an entire deliverable package, and wiring it into CI so regressions
are caught automatically going forward, matching the rigor already applied to the Rust side.
Suggested Execution
git checkout -b feature/sdk-test-infrastructure-cijest,ts-jest,@types/jesttosdk/package.json'sdevDependencies; add ajest.config.js/ts-jestpreset.BaseClient.invoke()talks to a real Soroban RPC endpoint, add a mocking layer (e.g.jest.mockaround@stellar/stellar-sdk'srpc.Server) so unit tests can exerciseKoraClient/each*Clientclass's argument-encoding and response-decoding logic without alive network — or, for deeper coverage, integrate a local Soroban sandbox /
stellar-clilocalnetwork in CI and run true integration tests against deployed test contracts.construction for each method (matching the parameter counts fixed in issues Refactor Treasury Contracts #7/Optimize Financing Pool Contracts #9), and
correct decoding of a mocked simulation/transaction response back into the documented TS types.
sdkjob to.github/workflows/ci.ymlthat runsnpm ci,npm run build(tsc),and
npm testinsidesdk/, gating merges the same way the Rust jobs do.Acceptance Criteria
npm testinsidesdk/runs and passes without manual setup beyondnpm install.github/workflows/ci.ymlcontains a job that builds and testssdk/on every PRGuidelines: PR description must include
Closes #<issue-number>.Complexity: High (200 points)