3. Testing in mocked mode
This tutorial walks you through performing tests in the mocked mode provided by the fhEVM Hardhat template.
Prerequisites
Before proceeding, ensure you have:
A configured Hardhat project using the fhEVM Hardhat template. (See the previous section)
Basic knowledge of Solidity and Hardhat testing. (See the Hardhat testing documentation)
Running your tests
To run tests in mocked mode, open a terminal in your project's root directory and execute:
# Using npm
npm run test
# Using yarn
yarn test
# Using pnpm
pnpm test
This command runs all tests locally in mocked mode. You should see the test results in your console.
Next steps
For most development and demonstration scenarios, mocked mode is sufficient. However, for production-ready development and a real testing environment, you need to run your tests on a real network where the coprocessor is deployed for example Sepolia. Refer to the next section on how to deploy your contract on Sepolia test network.
Last updated
Was this helpful?