Testnet: Monad Testnet, test USDC only, unaudited
Open app
On this page You need
All guide pages

Run the tests

How-to

Run each suiteLink to this section

  1. FairPay app tests (bills, payments, FairEats and GST maths, with an in-memory database and a fake chain).
    bash
    npm run test:fairpay

  2. Contract tests (run in-process).
    bash
    cd packages/contracts && npm install && npx hardhat test

  3. Start a local node in a second terminal and leave it running.
    bash
    cd packages/contracts && npx hardhat node

  4. Deploy the contracts to it.
    bash
    cd packages/contracts
    MERCHANTS=0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC \
      npx hardhat run scripts/deploy.ts --network localhost

    On PowerShell, set the variable first, then run the same command without the prefix:

    PowerShell
    $env:MERCHANTS = "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC"
    npx hardhat run scripts/deploy.ts --network localhost

    That address is a well-known public Hardhat test account, not anyone's wallet.

  5. SDK tests (unit tests and tests against the node), from the repository root.
    bash
    npm run build:sdk
    npm test -w @fairpay/sdk

  6. Standalone FairEats tests. Without a node, the tests that need one skip with a message and the run still passes.
    bash
    npm test

  7. Typecheck the apps.
    bash
    npm run typecheck -w fairpay-app
    cd apps/faireats && npx tsc -p tsconfig.json

Careful: the SDK and FairEats suites write to the local chain (mint, deposit, pay). Run them one at a time against a node nothing else is using.

Check: each command ends with all tests passing (or, without a node, skipped with a message).