How to run tests across the Pump SDK, Rust vanity generator, TypeScript vanity generator, and shell scripts.
The project has multiple test suites covering different components:
| Component | Framework | Location | Language |
|---|---|---|---|
| Core SDK | Jest | npm test (root) |
TypeScript |
| TypeScript vanity gen | Jest | typescript/ |
TypeScript |
| Rust vanity gen | Cargo test | rust/ |
Rust |
| Shell scripts | Bash | tests/cli/ |
Bash |
| Integration tests | Bash | tests/integration/ |
Bash |
| Benchmarks | Bash | tests/benchmarks/ |
Bash |
| Stress tests | Bash | tests/stress/ |
Bash |
| Fuzz tests | Python | tests/fuzz/ |
Python |
npm testnpx jest --watchnpx jest src/bondingCurve.test.tsnpx jest --coverageThe SDK uses Jest with ts-jest. See jest.config.ts at the project root (or package.json scripts).
cd typescript
npm install
npm test| Test | Purpose |
|---|---|
tests/generator.test.ts |
Key generation correctness |
tests/matcher.test.ts |
Prefix/suffix pattern matching |
tests/validation.test.ts |
Input validation and error handling |
tests/security.test.ts |
Zeroization and key material safety |
tests/integration.test.ts |
End-to-end generation flows |
Configuration: typescript/jest.config.js and typescript/tsconfig.test.json.
cd rust
cargo testcargo test -- --nocapture| Test | Purpose |
|---|---|
tests/integration_tests.rs |
Full generation pipeline |
tests/performance_tests.rs |
Speed and throughput |
tests/security_tests.rs |
Key material handling |
cargo benchBenchmark files are in rust/benches/generation_bench.rs.
# Test vanity address generation
bash tests/cli/test_generation.sh
# Test keypair verification
bash tests/cli/test_verification.sh# Test keypair validity
bash tests/integration/test_keypair_validity.sh
# Test output format compatibility
bash tests/integration/test_output_compatibility.sh
# Test security properties
bash tests/integration/test_security_properties.sh# Long-running stability test
bash tests/stress/long_running.sh
# Rapid generation burst test
bash tests/stress/rapid_generation.shCompare the Rust and TypeScript vanity generators:
bash tests/benchmarks/compare_implementations.shTest how performance scales with prefix length:
bash tests/benchmarks/scaling_test.shPython-based fuzz tests for edge cases:
# Fuzz input validation
python3 tests/fuzz/fuzz_validation.py
# Fuzz file operations
python3 tests/fuzz/fuzz_file_operations.pyFuzz test fixtures are in tests/fixtures/:
invalid-inputs.txt— list of malformed inputs to testREADME.md— fixture format documentation
A convenience script runs every test suite:
bash docs/run-all-tests.shOr use the Makefile:
make test- Create a file named
*.test.tsinsrc/or a__tests__/directory - Import from the SDK:
import {
getBuyTokenAmountFromSolAmount,
newBondingCurve,
bondingCurveMarketCap,
} from "../src";
import BN from "bn.js";
describe("bonding curve math", () => {
it("returns 0 for 0 input", () => {
const result = getBuyTokenAmountFromSolAmount({
global: mockGlobal,
feeConfig: null,
mintSupply: null,
bondingCurve: null,
amount: new BN(0),
});
expect(result.eq(new BN(0))).toBe(true);
});
});- Run:
npm test
Add tests to existing test files or create new ones in rust/tests/:
#[test]
fn test_my_feature() {
// Test code here
assert!(result.is_ok());
}Run: cd rust && cargo test
Security-focused tests are spread across components:
| File | What it verifies |
|---|---|
rust/tests/security_tests.rs |
Key material zeroization, file permissions |
typescript/tests/security.test.ts |
Key cleanup, no memory leaks |
tests/integration/test_security_properties.sh |
File permissions, no key exposure |
See SECURITY.md and security/SECURITY_CHECKLIST.md for the full security audit checklist.
- Contributing — How to submit changes
- Architecture — SDK design overview
- API Reference — Function signatures to test against