Closed AuroraLantean closed 10 months ago
This seems to be an issue with ts-mocha
as there are lots of comments in https://github.com/piotrwitek/ts-mocha/issues/70. You can use other testing frameworks, Anchor already supports creating projects with jest
with anchor init --jest
.
I got this error after updating Solana-cli to 1.9.4 and Anchor-cli to 0.20.1 and other local npm versions... please help.
Local npm package: @project-serum/anchor 0.18.2 Solana program dependencies: anchor-lang 0.18.2, anchor-spl 0.18.2, solana-program 1.9.4 Global environment: Rust 1.57.0, solana-cli 1.9.4, @project-serum/anchor-cli 0.20.1
Anchor.toml [script] command: This command works fine at the the other repo:
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
The problem is the m1.ts file cannot import functions from another ts file!!!??? in my utils.ts
in my m1 file:
the imported log1 function or any other function will cause the Unknown file extension ".ts" error!!??
my local package dependencies: "mocha": "^9.1.3", "ts-mocha": "^9.0.0-alpha1", "ts-node": "^10.4.0", "typescript": "^4.5.4"
Please advise. Thank you