Skip to main content
Noah gives you built-in tools to verify that your smart contracts behave as expected. When you build a smart contract, Noah automatically generates and runs test cases so you can catch bugs before deploying.
Screenshot showing Noah's test interface with 9 passed test cases for a smart contract

How Testing Works in Noah

When you create a smart contract, Noah automatically:
  1. Generates comprehensive test cases based on your contract logic
  2. Compiles your contract to check for errors
  3. Runs all test cases and displays results
  4. Shows pass/fail status, total count, and duration
You can view test results in the Test tab of your project toolbar. Each test case shows a clear pass or fail indicator so you can quickly identify issues.

What Noah Tests

Noah generates test cases that cover common smart contract scenarios:
  • Initialization — verifies the contract sets up correctly
  • Core functionality — tests the main instructions and logic
  • Input validation — checks that invalid inputs are rejected
  • Edge cases — tests boundary conditions like max lengths and empty values
  • Account handling — verifies correct account derivation and ownership
  • Error handling — ensures the contract fails gracefully on bad input

Running Tests

1

Build Your Smart Contract

Describe your smart contract to Noah using a prompt. Noah generates the contract code automatically.
2

View Test Results

Switch to the Test tab in the toolbar to see auto-generated test results. You’ll see total tests, passed, failed, and duration.
3

Fix Issues

If any tests fail, ask Noah to fix the issue. Describe the failing test or the expected behavior, and Noah will update the contract.
4

Re-run Tests

Click the Test button to re-run all test cases after making changes. Verify all tests pass before deploying.

Test Results Overview

The test interface shows you:
  • Total Tests — number of test cases generated
  • Passed — tests that completed successfully
  • Failed — tests that did not produce expected results
  • Duration — how long the test suite took to run
Each individual test case is listed with a clear description of what it verifies, making it easy to understand what’s being tested.

Generate IDL

After your tests pass, you can generate the IDL (Interface Definition Language) file for your Solana program by clicking Generate IDL.json. The IDL is required for integrating your smart contract with your web app.

Best Practices

Run all test cases and make sure they pass before deploying to Devnet or Mainnet. This catches bugs early and saves time and gas fees.
Deploy to Devnet and test your contract in a real environment before going to Mainnet. This is standard practice in blockchain development.
If you want to test specific scenarios, ask Noah to generate additional test cases. For example: “Add a test that verifies the token transfer fails when the balance is zero.”
After testing, generate an audit report to check for security vulnerabilities and best practices.

FAQ

Yes. When you build a smart contract, Noah automatically generates and runs test cases for your contract’s logic.
Yes. Ask Noah in the chat to add specific test cases, and it will generate them for your contract.
Running tests is part of the smart contract development flow and uses credits as part of your build process.
Currently, the Test tab and automated test generation are available for smart contracts (Solana programs and Solidity contracts).