I'm currently working on a Solana project using Anchor and I've encountered an issue when running anchor test. The error message I'm receiving is:

Error: Error reading (possibly relative) path: ../../target/deploy/misc.so. If relative, this is the path that was used as the current path: /Users/alex/happy/web3/solana/test-project/node_modules/anchor/tests/misc/tests/misc/Test.toml

I've checked and the misc.so file does exist at the specified path. I've also tried using an absolute path in the Test.toml file, but the issue persists.

I'm not sure what's causing this issue. Any help would be greatly appreciated.

1 Answer 1


Usually you do not need a test.toml file. Could you maybe post the link to you repo?

Usually an anchor.toml like this is enough:

seeds = false
dragonkarting = "..."

url = "https://anchor.projectserum.com"

cluster = "devnet"
wallet = "~/.config/solana/id.json"

test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"

This will run all the tests in the tests folder. Also make sure to yarn install and run the tests from the program folder.

Here is for example a working example: https://github.com/solana-developers/program-examples/blob/main/tokens/token-2022/transfer-hook/anchor/TransferHookHelloWorld/Anchor.toml

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.