StarknetCC - TDD workshop by Alpha Road team
This workshop will show you how to do TDD (Test Driven Development) with your Cairo contracts. You can choose to test your contracts using Pytest (test with python) or using Protostar (test with Cairo).
You can find the presentation here.
To follow this workshop you should at least have basic knowledge in Cairo smart contracts development.
You also need to set up your environment
- Test and complete boolean.cairo (if protostar) or boolean_contract.cairo (if pytest)
- Test and complete main.cairo
- Test and complete AccessController.cairo
Documentations:
# Install dependencies first (openzeppelin)
protostar install
# Then run tests
protostar test
# Run a specific test file
protostar test tests/test_boolean.cairo
# Install pytest
pip install -U pytest
# Install test dependencies
pip install -r tests/requirements.txt
# Then run tests
pytest tests
# Run a specific test file
pytest tests/test_boolean_contract.py