onflow / developer-grants

Grants for developers that contribute to the broader developer ecosystem
Apache License 2.0
50 stars 18 forks source link

OpenSource Maintenance: Flow JS Testing #138

Open MaxStalker opened 1 year ago

MaxStalker commented 1 year ago

Flow JS Testing

Grant category

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

Evidence for the need

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
LanfordCai commented 1 year ago

My first choice testing library๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰

orodio commented 1 year ago

Testing is important

FelipeRibeiroLabs commented 1 year ago

We need this!

crash13override commented 1 year ago

+1 on everything!! :)

salahawk commented 1 year ago

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 !!!!

bjartek commented 1 year ago

The more testing options the better.

C-3PFLO commented 1 year ago

If you canโ€™t test it, I usually donโ€™t bother to write it. This is a must have.

m-Peter commented 1 year ago

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:

MaxStalker commented 1 year ago

Great idea, @m-Peter ! ๐Ÿ’ฏ

hichana commented 1 year ago

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.

ph0ph0 commented 1 year ago

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!

turbolent commented 1 year ago

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! ๐Ÿ‘

gregsantos commented 1 year ago

Jumping in here to support this proposal and Max's continued work maintaining Flow JS Testing library

fotescodev commented 1 year ago

Let's go! We will kickstart the process this week @MaxStalker. I'll reach out to you with details ๐Ÿ™Œ

MaxStalker commented 1 year ago

Thank you everyone for your support! ๐Ÿ™‡โ€โ™‚๏ธ

Looking forward to it. @fotescodev !

psiemens commented 1 year ago

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.

MaxStalker commented 1 year ago

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 ๐Ÿ”ฎ๐Ÿ˜Š!

alilloig commented 1 year ago

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.

justinbarry commented 1 year ago

Awesome! Could we add either jsdoc annotations or typescript conversation as part of this as well?

MaxStalker commented 1 year ago

@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!

jacob-tucker commented 1 year ago

You got all my support Max! I need Flow JS Testing so I can make YT videos on how to test :D

adbario commented 1 year ago

Full support from here ๐Ÿ‘ This would really help JS devs to start building on Flow ๐Ÿš€

fotescodev commented 1 year ago

Congratulations in getting the grant accepted @MaxStalker! Now let's get to work ๐Ÿš€

salahawk commented 1 year ago

Congrats, @MaxStalker