4

I cloned my anchor repo but after installing the modules and building, testing the program results in 0 of the test cases running.

Here are the logs


Found a 'test' script in the Anchor.toml. Running it as a test suite!

Running test suite: "/home/jimii/Documents/crew/nft/Anchor.toml"

yarn run v1.22.19
$ /home/jimii/Documents/crew/nft/node_modules/.bin/ts-mocha -p ./tsconfig.json -t 1000000 'tests/**/*.ts'


  0 passing (0ms)

Done in 0.52s.
Error: No such file or directory (os error 2)

2 Answers 2

4

The anchor test command fails but it swallows the error message.

You can run the test command manually to see why it's failing.

Look in Anchor.toml for the test command in the [scripts] section and run the command manually

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

For example, the issue might be that yarn is not installed or you have an outdated version of Node.js (v20 or higher is recommended).

1
  • I tried running this but still got the same response. No tests are being run. ts yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts yarn run v1.22.19 $ /home/jimii/Documents/crew/nft/node_modules/.bin/ts-mocha -p ./tsconfig.json -t 1000000 tests/admin-test.ts tests/config.ts tests/loan-test.ts tests/rent/buy-test.ts tests/rent/durability.ts tests/rent/normal.ts tests/rent-test.ts tests/rent/trial.ts tests/sdktest.ts tests/streammoney-nft_old.ts tests/streammoney-nft.ts 0 passing (1ms) Done in 1.08s.
    – Jimii
    Commented Jan 18 at 8:56
1

Seems like using async for the top level describe was my issue and awaiting a method in the describe block was my issue

Details in this SO Answer

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.