The tests require Node.js, npm and npx.
Docker is needed by the docker_sandbox
test targets. (Not supported on Apple Silicon.)
make unittest
to build the contract and run unit tests.
Testing against a real NEAR instance is the best way to assure that all contract functions are correct. There are several ways to do this:
-
make docker_sandbox_start
will launch a NEAR sandbox (aneard
instance inlocalnet
mode) in a Docker container.
Note for Mac users: at the time of this writing, this option does not work on Apple Silicon. -
make local_sandbox_start
will clone theneard
source from Github, then build and launch a local NEAR sandbox. -
You may also test against any other NEAR sandbox, by configuring these environment variables:
NEAR_SANDBOX_NODE
-- hostname or IP of remoteneard
, or leave blank forlocalhost
NEAR_SANDBOX_PORT
-- TCP port ofneard
, or leave blank for3030
-
You may also run sandbox tests on the offical NEAR testnet. We use this mainly to confirm that tests past against an actual Mintbase contract as well as they do against our stub. To test on testnet, you must set at least these two environment variables:
NEAR_ENV
="testnet"NEAR_TESTNET_ACCOUNT
="a.valid.account.on.NEAR.testnet"
Once one of those sandbox options is configured and running,
make sandboxtest
to run the main sandbox testsmake sandboxtest_all
to run the main tests plus a time-consuming stress test.