Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadEnv ¶
func LoadEnv()
Loads the environment for the tests. It must be called before `m.Run` in the TestMain function of each package. It looks for a `.env.<testEnv>` file in the `internal/tests` directory, where `<testEnv>` is the value of the `-env` flag. If the file is not found, a warning is logged.
func RunTestOn ¶
Runs the test only if the environment is in the list of environments provided. If no environment is provided, the test fails. If the environment is not in the list of environments, the test is skipped.
Packages like `account` and `rpc` are run on multiple environments, so in order to easily skip tests that are not supported on a specific environment, we use this helper. If a test is not supported on a specific environment, it should be skipped; otherwise, it could pass (since the environment is not being tested) and give a false positive.