Test Suite Migration Tool Between Frameworks (Truffle to Foundry)
Free to download on every platform. Comes pre-installed on BotFone, BotPad and BotFlip — with extra free apps included.
About this app
WHAT IT DOES
Test Suite Migration Tool Between Frameworks (Truffle to Foundry) helps developers transition from Truffle to Foundry by automatically translating JavaScript test files into Foundry‑style Solidity tests. It parses Truffle test syntax — including artifacts.require, contract() blocks, it() test cases, async/await patterns, and assert statements — and maps them to corresponding Foundry constructs. The output is a Solidity test file that imports forge‑std/Test.sol, declares a test contract, uses setUp() for deployment, and converts each it() block into a public test function. The tool handles common assertion translations, accounts array mapping, and basic deployment patterns.
HOW TO USE
Paste your Truffle JavaScript test file (typically located in test/*.js) into the input area. Click "migrate to Foundry". The tool analyzes the source and produces a Solidity test file with a .sol extension. Review the output for manual adjustments — especially around deployment logic, custom assertions, and complex async flows. Copy the migrated code into your Foundry project's test/ directory, then run forge test to verify the converted tests work as expected. The tool is read‑only; it does not connect to any blockchain or execute any transactions.
THE REAL MECHANISM
The migration engine uses a line‑by‑line parser that identifies Truffle‑specific patterns via regular expressions. It extracts contract names from artifacts.require() calls, test descriptions from contract() and it() blocks, and captures the body of each test function. Assertions like assert.equal, assert.isTrue, and assert.reverts are mapped to Foundry equivalents (assertEq, assertTrue, vm.expectRevert). Async/await wrappers are removed because Foundry tests are synchronous. The accounts array is converted to vm.addr(n) for n > 0, and accounts[0] becomes address(this). The parser also tracks nested braces to correctly delimit test functions and handles multiple test blocks within a single file. All processing is local — no code leaves your browser.
WHAT IT CANNOT SEE
The tool cannot automatically fix all syntax differences, detect semantic errors in migrated tests, verify that migrated tests cover the same edge cases, handle custom Truffle plugins or Foundry‑specific cheatcodes not present in the source, ensure the migration preserves test timing or event ordering, or test the migrated suite. The output is a starting point — manual review and adjustment are essential. Complex patterns like try/catch, event filtering, or custom Chai assertions may not translate correctly.
PLEASE NOTE — EVM CHAINS ONLY
This tool is designed for Solidity projects on Ethereum Virtual Machine (EVM) compatible chains. It assumes Foundry's standard testing patterns and does not support other frameworks or non‑EVM chains. All processing occurs in your browser; no contract data is stored or transmitted.