ts-node and mocha ‘TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension “.ts”‘ error even with “ts-node/esm” loader and CommonJS modules
i’m using same configuration like yours but it only work when i downgrade to ts-node@9, and then i tried this option in my .mocharc.json and now it’s working as i expected { “extensions”: [“ts”], “spec”: [“**/*.spec.*”], “node-option”: [ “experimental-specifier-resolution=node”, “loader=ts-node/esm” ] }