-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cadence Test Framework Improvements #148
Comments
Hi @m-Peter! Thanks for submitting your proposal - just wanted to let you know that we've accepted your proposal and are following up directly with next steps. |
Hey @chrisackermann 👋, I have actively started development on this proposal as well. The 1st PR tackling the addition of new built-in matchers, can be found here onflow/cadence#2420 🙏 |
Excellent news @m-Peter ! |
Love the proposal, I Like to include the minor stuff as well like -
|
@satyamakgec Much thanks for your feedback 🙇 |
@franklywatson The repository containing usage examples about the testing framework has moved here: https://github.com/m-Peter/flow-code-coverage. This is where I will put samples for any new features. |
Nice work! Closing since this is now completed |
Cadence Test Framework Improvements
Grant category
Description
The Flow Emulator is the developer tool for the Flow blockchain which allows the development of Cadence smart contracts, scripts and transactions. It is bundled with the
flow-cli
tool. Among the supported commands of theflow-cli
, there is also atest
command, which runs tests written with the Cadence testing framework, while utilizing the Flow Emulator under the hood.I would like to make the Cadence testing framework more feature-rich, by implementing the features described in onflow/cadence#1889 (
Matchers
/Unit Testing
/Integration Testing
/Deployed Contracts
/Logs & Events
)Problem statement
Testing is an essential part of the development workflow. The Cadence testing framework, as of now, has a basic set of features that makes it functional, however it needs more features to make it a fully-fledged testing framework.
Proposed solution
The
TestFramework
interface has to include the proposed API from onflow/cadence#1889. This API has to be implemented in the Cadence testing stdlib (runtime/stdlib/test.go
) and the emulator-backed implementation (test/emulator_backend.go
). The relevant code files can be found below:Impact
Provide
test
/development
parity, by allowing developers to write unit/integration tests in Cadence (https://12factor.net/dev-prod-parity). Developers will also be able to measure how well their tests cover their contracts, and gain sufficient confidence before deploying to testnet, and more importantly on mainnet. Code coverage will be natively offered by the framework.Milestones and funding
Total Cost: 71,250 USD. Of course, I am open to discussion, regarding the cost and timeline 🙂 .
Team
The text was updated successfully, but these errors were encountered: