All guide pages
Run the tests
How-to
Run each suiteLink to this section
- FairPay app tests (bills, payments, FairEats and GST maths, with an in-memory database and a fake chain).bash
npm run test:fairpay - Contract tests (run in-process).bash
cd packages/contracts && npm install && npx hardhat test - Start a local node in a second terminal and leave it running.bash
cd packages/contracts && npx hardhat node - Deploy the contracts to it.bash
cd packages/contracts MERCHANTS=0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC \ npx hardhat run scripts/deploy.ts --network localhostOn PowerShell, set the variable first, then run the same command without the prefix:
PowerShell$env:MERCHANTS = "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" npx hardhat run scripts/deploy.ts --network localhostThat address is a well-known public Hardhat test account, not anyone's wallet.
- SDK tests (unit tests and tests against the node), from the repository root.bash
npm run build:sdk npm test -w @fairpay/sdk - Standalone FairEats tests. Without a node, the tests that need one skip with a message and the run still passes.bash
npm test - 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).