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

What's left for eth-testing to be feature complete? #66

Closed
neuodev opened this issue Feb 17, 2023 · 3 comments
Closed

What's left for eth-testing to be feature complete? #66

neuodev opened this issue Feb 17, 2023 · 3 comments

Comments

@neuodev
Copy link
Contributor

neuodev commented Feb 17, 2023

Open

I was researching the dApps E2E testing recently as my team was trying to add E2E testing (using Cypress) to make sure we are that any new changes don't break older ones. After a little bit of research, I found that this area (dApps E2E testing) is a little bit immature and there is a lot to be done! Most of the current solutions are still in beta or deprecated for some reason.

I came across this eth-testing and found it trying to address this issue.

Yet (as with other solutions) I found this warning on top.

⚠️ The package is quite young, any contributions, issues or feedbacks are welcome ⚠️

I have a couple of questions regarding eth-testing.

  1. Is it reliable to use with Cypress?
  2. What is left for eth-testing to be feature complete? Feel free to share any road map.

Finally, I wound like to offer my help!! WDYT?

@VGLoic
Copy link
Owner

VGLoic commented Feb 17, 2023

Hey @AhmedIbrahim336! Thanks a lot for this issue :)

Sooo about the questions

What is left for eth-testing to be feature complete? Feel free to share any road map.

I would say that the library is currently good enough to be used seriously. I am using it in my personal projects and also in my professional project (but only on the backend and I still did not have the occasion to use it on a big frontend project). Given the downloads, there are also a few people using it but they don't have that much remarks for now 😀

I don't have any road map but it would definitely be interesting that I work on that, I will try to spend time for that this weekend :)
Right now, the priorities are

Thanks a ton for offering your help on this, it would be amazing! I'll think on how I can encourage you (and other people) to contribute!

And I will remove this warning message as I think it's time to remove it :)

Is it reliable to use with Cypress?

So I never used it with Cypress yet. I would be happy to know if it works 🤔. I think it would be worth to check if you could inject a generated mock provider as a fake MetaMask in the browser window managed by Cypress :). If it can be done, then it should be good to go!

I just want to insist on a point. This library can maybe (and I hope) be used for tools such as Cypress or other E2E testing, however, it is not its primary target.

As we are still talking about a mock (i.e. you don't interact with a real blockchain), its primary target is more unitary and integration tests.

Testing in Ethereum applications is a big topic because it becomes complex to write good tests right very quickly. This library is meant to mock the connection to an Ethereum node so it finds its meaning naturally in unit or integration tests. It would be the equivalent to msw or nock in more traditional software :)

About E2E in Ethereum application

This is a topic that I always wanted to explore and clarify but I still did not have the occasion to do unfortunately. I know there are some interesting investigations in the space with synpress for example!

Regarding this library, as I said, if you are using it for E2E, then you are not doing "real" E2E as you are mocking the blockchain interaction part of the system. However, it is already great if you have all the other components of the system as real and the only remaining mocked part is the blockchain 😁.

I believe full E2E in Ethereum app could be done with

  • blockchain network: either some test networks (Goerli, Mumbai, else) or either a fork network using Ganache or Anvil,
  • wallet: MetaMask using Synpress (I never tested yet 🙈) or a burner wallet 🤔

Sorry all of this is a bit confusing and I hope you find the answers you are looking for in all of this 😅

Does that answer your questions?

I'll keep you updated on the road map though :)

@neuodev
Copy link
Contributor Author

neuodev commented Feb 17, 2023

Thank you so much for your detailed answer 👐

This is a topic that I always wanted to explore and clarify but I still did not have the occasion to do it, unfortunately. I know there are some interesting investigations in the space with synpress for example!

I did try Synpress but it didn't work for me for some reason. However, I will give it another chance.

So I never used it with Cypress yet.

Yup, it works 🎉 🎉 I did today a proof of concept example in which I mocked the connected wallets, the wallet balance, and the chain!!

I will try to open a PR with a Cypress example! WDYT?

Thanks again!

To close this issue I will open a PR to remove this warning message!

@VGLoic
Copy link
Owner

VGLoic commented Feb 19, 2023

It would be amazing to have some Cypress example, I hope it will work without too much struggle!

Thanks a lot for spending time on this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants