Template repository for minimal setup to test TON funC smart contracts.
This template uses the following libraries:
ton-contract-executor: run as the local TVM.func-js: used to compile the funC smart contract.
# install dependencies
npm i
# run the test
npx ts-mocha -p tsconfig.json --exit <:test-file.tx>
the ton package is locked to version 12.3.3. The ton-contract-executor is not compatible with version >= 13.0.0 (see: issue).
You can add ~dumps(xxx) to let the smart contract output debug values to the log (link):
After the ~dumps(xxx), you can use the send.logs the following to print the transaction log:
const send = await contract.sendInternalMessage(
    new InternalMessage({
        // ... skip here for demo purpose
    })
);
// print the logs of the transactions to debug.
console.log(send.logs);Note that the smart contract instance must be created with the debug flag set to true. Otherwise, the ~dumps() will be ignored:
contract = await SmartContract.fromCell(
    codeCell, // code
    beginCell().endCell(), // init data
    {debug: true} // <-- set the debug flag
);