| name | testing |
|---|---|
| description | How to run and extend tests — Jest e2e (test/*.js), TypeScript tests, test/config.js env, dist build. |
| Goal | Command |
|---|---|
| Lint | npm run lint |
| Full test (includes build) | npm test — runs pretest → npm run build, then test:e2e + test:typescript |
| JS Jest suite only | npm run test:e2e — config: jest.js.config.js |
| TypeScript / Jest | npm run test:typescript — config: jest.config.js |
| Build | npm run build — required before trusting dist/ against updated src/ |
- Wired from
test/index.jsviarequire(...). jest.js.config.jssetstestEnvironment: node, HTML reporters, and ignore patterns fortest/index.js,test/config.js,test/sync_config.js, and certainutils.jspaths — check the config when adding files.
Authoritative validation: test/config.js (uses dotenv).
Required when importing test/config.js (used by tests that need stack credentials):
HOST— delivery API host for your region/stackAPI_KEYDELIVERY_TOKENENVIRONMENT
If any are missing, the process throws on import. Use a local .env; never commit real tokens.
jest.config.js: ts-jest, transforms for TS/JS; HTML report undertypescript-html-report/per config.- Use for type-level and behavioral checks against the public SDK shape; keep assertions aligned with
index.d.ts.
- No committed
only/skipfor CI-mandatory tests. - Prefer stable ordering and avoid time-dependent assertions unless unavoidable.
.cursor/rules/testing.mdctest/README.md