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"
  ]
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)