avajs / ava

Node.js test runner that lets you develop with confidence 🚀
MIT License
20.74k stars 1.41k forks source link

when using typescript, type errors aren't shown #3067

Closed odama626 closed 2 years ago

odama626 commented 2 years ago

When using typescript, when you have a type error, instead of getting the error from ts-node, you get the error "timed out while running tests"

// ava.config.js
export default {
  files: ['packages/**/*.test.(j|t)s'],
  extensions: {
    js: true,
    ts: 'module',
  },
  nodeArguments: ['--loader=ts-node/esm'],
};
novemberborn commented 2 years ago

This is a problem with ts-node. AVA needs there to be an uncaught exception, but ts-node seems to fail silently. See also the discussion here: https://github.com/avajs/ava/discussions/3033#discussioncomment-2845448.