Skip to content
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

Add examples to testing framework docs #2236

Closed
MrDSGC opened this issue Jan 11, 2023 · 6 comments
Closed

Add examples to testing framework docs #2236

MrDSGC opened this issue Jan 11, 2023 · 6 comments
Assignees
Labels
Documentation Improvements or additions to documentation Feedback

Comments

@MrDSGC
Copy link
Contributor

MrDSGC commented Jan 11, 2023

Issue to be solved

Cadence Testing Framework documentation could use some examples to help users test on Flow

https://discord.com/channels/613813861610684416/1055155961196728380/1055155961196728380

Suggested Solution

Add examples to Cadence Testing Framework

@turbolent turbolent changed the title Update dev portal documentation Add documentation for testing framework Jan 11, 2023
@turbolent turbolent removed their assignment Jan 11, 2023
@turbolent turbolent added Documentation Improvements or additions to documentation and removed Feature labels Jan 11, 2023
@j1010001 j1010001 changed the title Add documentation for testing framework Add examples to testing framework docs Jan 26, 2023
@j1010001
Copy link
Member

can we get some help from core-contract team here @franklywatson ?

@franklywatson
Copy link
Contributor

franklywatson commented Jan 27, 2023

Been chatting to the SCE team and we still feel that it's some ways away from widespread use. @satyamakgec made a valiant effort to code as much of the testing in Offers using the framework over the past weeks. The TL;DR still remains, it's not there yet. Until then it doesn't make sense to cut examples (though the above repo already give us the base material for when it's needed)

  1. Allow defining types or contracts locally in the test file itself - my understanding is that this is one of the more frustrating things
  2. Contracts, scripts and transactions as first-class citizens in testing framework Somewhat duplicates the item above but looking at different aspects
  3. Provide detailed information about the error during smart contract execution in test This is required to cover negative test cases of the contract so that all code branches get coverage
  4. No GH issue - right now it is impossible to return & consume a variable return type from the scripts within the testing framework, but there should be something so that these can be properly tested

@SupunS
Copy link
Member

SupunS commented Jan 27, 2023

No GH issue - right now it is impossible to return & consume a variable return type from the scripts within the testing framework, but there should be something so that these can be properly tested

I guess this is onflow/cadence-tools#33. Should be already fixed in the latest CLI.

@m-Peter
Copy link
Contributor

m-Peter commented Mar 2, 2023

As part of an ongoing grant proposal, regarding code coverage, I have setup this repository which I intend to use for the adoption milestone, and as a learning resource for the Cadence testing framework.
I would like to undertake this issue, if you also agree, and enrich the following doc. I have a lot of examples, scattered in gists. cc @SupunS @turbolent

@m-Peter
Copy link
Contributor

m-Peter commented Sep 4, 2023

@j1010001 I think this issue can be closed. I have added relevant documentation in the onflow/docs repository:

@SupunS
Copy link
Member

SupunS commented Sep 5, 2023

Sounds good!

Closing this issue since examples have been added to the docs as mentioned above. Please feel free to re-open or open a new issue if you feel there are more areas we can improve on the docs.

@SupunS SupunS closed this as completed Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements or additions to documentation Feedback
Projects
None yet
Development

No branches or pull requests

6 participants