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

feat: add test for hardhat testing tutorial #35

Merged
merged 6 commits into from
Jul 25, 2024

Conversation

sarahschwartz
Copy link
Contributor

@sarahschwartz sarahschwartz commented Jul 24, 2024

This PR adds a testing framework and example test for the "How to test smart contracts with Hardhat" tutorial. The test is run in a github workflow on every pull request, and can also be run locally with bun test:github or bun test:local to see the browser.

How it works: the test collects all of the actions in <span> elements on a given page and executes the steps in order. In this test, it builds the hardhat project and runs the test inside the tests-output folder.

I couldn't figure out how to get run the npx hardhat init command to run in the test, so as a work around it clones the hardhat repo and pulls the same example from the source.

@sarahschwartz sarahschwartz added documentation Improvements or additions to documentation enhancement New feature or request labels Jul 24, 2024
@sarahschwartz sarahschwartz self-assigned this Jul 24, 2024
Copy link

github-actions bot commented Jul 24, 2024

Visit the preview URL for this PR (updated for commit d05c4c7):

https://community-cookbook-staging--pr35-sarah-testing-exampl-vg7n8vx7.web.app

(expires Thu, 01 Aug 2024 17:25:25 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 1b876338aafcf55b4a02f1877984e116731756b1

@sarahschwartz sarahschwartz marked this pull request as ready for review July 24, 2024 20:43
@sarahschwartz sarahschwartz requested a review from a team as a code owner July 24, 2024 20:43
@sarahschwartz sarahschwartz merged commit 3737777 into main Jul 25, 2024
10 checks passed
@sarahschwartz sarahschwartz deleted the sarah/testing-example branch July 25, 2024 19:23
Copy link

🎉 This issue has been resolved in version 1.3.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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 enhancement New feature or request released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants