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

Writing automated smart contract tests: instructions are not clear and the code is not running #422

Open
antontranelis opened this issue Dec 12, 2024 · 0 comments

Comments

@antontranelis
Copy link

I have some confusion with running performing-complex-assertions in "Writing automated smart contract tests."

The doc say: "OpenZeppelin Test Helpers is web3.js based, thus Hardhat users should use the Truffle plugin for compatibility. However, we recommend instead using Hardhat Chai Matchers as a better supported alternative for Ethers.js."

So what should I use now to run the code below? The Truffle plugin or hardhat-chai-matchers?

using hardhat-chai-matchers results in:

An unexpected error occurred:
ReferenceError: contract is not defined
    at Object.<anonymous> (/home/fritz/workspace/learn/test/Box.test.js:20:1)

using the truffle plugin results in:

     TypeError: Box.deployed is not a function
      at Context.<anonymous> (test/Box.test.js:15:13)

@antontranelis antontranelis changed the title Writing automated smart contract tests: instructions are not clear and the code does not read Writing automated smart contract tests: instructions are not clear and the code is not running Dec 12, 2024
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

1 participant