Updated: December 2025
Status: Tests configured with modern tooling
clarinet test # This no longer works!npm test # Use this instead- Vitest - Modern testing framework
- @hirosystems/clarinet-sdk - Stacks testing utilities
- TypeScript - Type-safe test code
tests/
├── setup.ts # Test configuration
├── flashstack-core_test.ts # Core protocol tests
└── sbtc-token_test.ts # Token contract tests
npm installYou'll see these warnings (safe to ignore):
npm warn deprecated @hirosystems/clarinet-sdk@2.16.0
npm warn deprecated @hirosystems/clarinet-sdk-wasm@2.16.0
# Run all tests
npm test
# Run tests in watch mode (for development)
npm run test:watch# Quick validation (no Docker needed)
clarinet check$ npm test
✓ tests/flashstack-core_test.ts (X tests)
✓ tests/sbtc-token_test.ts (X tests)
Test Files 2 passed (2)
Tests X passed (X)- Check error messages carefully
- Verify contract syntax:
clarinet check - Make sure all dependencies installed
- Check setup.ts configuration
Solution: Use npm test instead
Solution: You don't need Docker for npm test, only for clarinet integrate
Solution:
# Clean install
rm -rf node_modules package-lock.json
npm installSolution: These are safe to ignore for now. The SDK still works perfectly.
Tests the main protocol:
- Flash mint functionality
- Fee calculations
- Admin functions
- Pause/unpause mechanism
- Error handling
Tests the token contract:
- Mint/burn operations
- Transfer functionality
- Flash minter permissions
- Balance tracking
- Contract syntax (via
clarinet check) - 11 contracts compile successfully
- 6 warnings (expected, these are Clarity analyzer suggestions)
- Run
npm testto execute test suite - Verify all test cases pass
- Check integration scenarios
- Run
npm testto execute test suite - Review any failures
- Fix issues if needed
- Document test coverage
- Add more edge case tests
- Consider integration tests
- Read error messages carefully
- Check contract logic
- Verify test expectations
- Update tests if needed
# Always run these
clarinet check # Syntax validation
npm test # Test suite- Write tests first (TDD)
- Implement feature
- Run tests
- Refactor if needed
Test thoroughly on devnet/testnet before mainnet:
# 1. Check syntax
clarinet check
# 2. Test in console
clarinet console
> (contract-call? .flashstack-core flash-mint u1000000 .your-receiver)
# 3. Run automated tests
npm test- QUICKSTART.md - Getting started
- README.md - Project overview
- DEPLOYMENT.md - Deployment guide
# Install dependencies
npm install
# Run tests
npm test
# Watch mode
npm run test:watch
# Check syntax
npm run check
# or
clarinet check
# Open console (requires Docker)
npm run console
# or
clarinet console- Node.js 16+ installed
- npm packages installed
- No syntax errors (
clarinet checkpasses) - All files in correct locations
- setup.ts properly configured
- Test files have .ts extension
If tests still don't work:
- Check Node version:
node --version(need 16+) - Clean install:
rm -rf node_modules && npm install - Verify Clarinet:
clarinet --version - Create GitHub issue with error details
Ready to test?
cd C:\Users\mattg\flashstack
npm testGood luck! 🚀