developer-grants
developer-grants copied to clipboard
OpenSource Maintenance: Flow JS Testing
Flow JS Testing
Grant category
- Open source maintenance
Description
Flow JS Testing - https://github.com/onflow/flow-js-testing - is a set of utility functions, which allows developers to write tests using Javascript and Jest. You can easily deploy contracts, execute scripts, sign and send transactions.
I authored and brought this library to life and now I want to get it "back" and continue maintaining it ๐ค
Target audience
- New developers who learn their way around Cadence
- Cadence developers who wants to use Javascript to write tests for a production grade project
Evidence for the need
- โญ 46 stars, 30 forks
- Official Kitty Items is using it - 215 forks
- 20+ known projects using
- 23 open issues in repository, some are breaking the pipelines for active projects ๐คทโโ๏ธ
- Active Discord channel
flow-js-testingwith multiple questions and challenges solved ๐ค - +20,000 Total Downloads on npm (original and branded)
Proposed solution
I will apply my accrued knowledge to provide support for this library and it's dependencies ๐
Impact
Javascript is still in Top-5 Programming languges used for web and blockchain development. Providing first-class support for Cadence testing with it will benefit those who will choose it and open possibilities for newcomers.
It's also much easier to teach someone how to test Cadence code if they are already using Javascript or Typescript to build their front-end part.
Milestones and funding
| Milestone | Deliverables | Timeline | Risks | USD proposal |
|---|---|---|---|---|
| 1 - New stable release | New release supporting latest CLI, FCL-JS and emulator. Dependency testing suit to ensure stability | ~4 weeks | Current release is not stable enough to be used with latest CLI release | 5,000 |
| 2 - Add Storage Query | New methods and documentations how to query storage using latest changes in Cadence and emulator | ~4 weeks | No risk, but it's a really nice-to-have feature, which will enhance testing experience ๐โโ๏ธ | 5,000 |
| 3 - Setup CI/CD pipeline | Set of Github Actions, which will track latest releases for all dependencies, run tests and raise an issue if some of them are failing and needs attention | ~4 weeks | Dependency release may easily break working pipeline | 5,000 |
| 4 - Dev.to Articles | 4 articles | 4 weeks | As I witnessed, documentation is often not enough to be able to use tools effectively | 4,000 |
| Maintenance | Resolving issues and fixing bugs | Every month for 3 months | - | 7,000 per month |
| Community Assistance | Helping users resolve their issues and challenges via Discord and Github | Every month for 3 months | Developers who wouldn't get swift response might swap chains to get better support | 3,000 per month |
Team
| Name | Role | Bio | Contact |
|---|---|---|---|
| Max | DevEx Engineer | OG MaxStarka: Creator of flow-js-testing, flow-cadut and Playground extensions | @MaxStalker |
My first choice testing library๐๐๐
Testing is important
We need this!
+1 on everything!! :)
I really look forward to having a stable flow testing JS framework. All are struggling with testing and most of them use JS. And current version has some issues when it comes to different versions of FCL, CLI (especially, the latest version)
What's more? We don't have enough materials / documents / articles / samples related to Cadence and Flow out there, thus, appreciate the idea about writing articles ๐
Can't wait !!!!
The more testing options the better.
If you canโt test it, I usually donโt bother to write it. This is a must have.
One last piece to complete the puzzle, is adding code coverage. A hint left from bluesign here: https://github.com/onflow/developer-grants/issues/113#issuecomment-1381793687, for another grant that is in review https://github.com/onflow/developer-grants/issues/132. It would be really awesome seeing the deliverable of one proposal, to empower another :pray:
Great idea, @m-Peter ! ๐ฏ
I think it could help a lot of people if it were made more robust, especially those who want to keep JS as their core tool for both their app and testing.
We use flow-js-testing at The Fabricant, and one of the most frustrating parts of development for me at the moment is testing. fjs in its current state is incredibly temperamental, hinders our development process and erodes some of the incredible DevEx that Flow has worked so hard on.
A well maintained, active testing library that is kept up to date with CLI/Cadence releases is essential to seamless development. As Bjarte said, a variety of testing options is important for developers. I believe that many people in the community would agree that the product of this grant proposal would be hugely beneficial! Thanks @MaxStalker for putting this together!
Can only second ๐ฏ what was said before, would love to see Max being able to continue maintaining the great testing library which is much needed! ๐
Jumping in here to support this proposal and Max's continued work maintaining Flow JS Testing library
Let's go! We will kickstart the process this week @MaxStalker. I'll reach out to you with details ๐
Thank you everyone for your support! ๐โโ๏ธ
Looking forward to it. @fotescodev !
Also voicing my support for @MaxStalker's proposal!
Max, I have some feedback that I'll put into some issues, but in general I think it'd be great if there was a way to access a lower-level API in flow-js-testing that makes it easier to use inside an existing testing library like Jest or Mocha.
Thank you for your support and feedback, @psiemens !
I was experimenting with custom environment for Jest, which would provide emulator on "invisible" layer with no extra setup needed from user.
Also been playing with Bun - https://bun.sh/ - to provide faster JS runtime and test executions.
Future looking bright for this framework ๐ฎ๐!
I would love to see Max taking care of the js testing!! Probably he's one, if not the one, who better knows how it works, and always have been kindly enough to answer any question I may have about it.
Awesome! Could we add either jsdoc annotations or typescript conversation as part of this as well?
@justinbarry I annotated all of the exposed functionality with jsdoc format - here's example of sendTransaction function:
https://github.com/onflow/flow-js-testing/blob/master/src/interaction.js#L112
But it's not preserved during bundling and package building. Maybe I am just "cooking" it wrong - would appreciate any help on that front ๐โโ๏ธ
Typescript types are available here: https://www.npmjs.com/package/@types/onflow__flow-js-testing
Though should be part of the whole package - totally agree on that!
You got all my support Max! I need Flow JS Testing so I can make YT videos on how to test :D
Full support from here ๐ This would really help JS devs to start building on Flow ๐
Congratulations in getting the grant accepted @MaxStalker! Now let's get to work ๐
Congrats, @MaxStalker