theintern / intern

A next-generation code testing stack for JavaScript.
https://theintern.io/
Other
4.36k stars 310 forks source link

[Request] TypeScript integration guide #1173

Open tifrel opened 3 years ago

tifrel commented 3 years ago

What's wrong?

A config line line from the official documentation currently breaks tests with TS (source in TS, tests in TS). However I titled this Issue as request for a TypeScript integration guide, because I also encountered issues with certain options in my tsconfig.json, unfortunately I cannot recall the keys right now. At one point not even the debug flag would help and intern just exited non-zero, no message or anything.

Possible solution

Quite often the problem with TS and Intern are related to importing/exporting, maybe the stuff can be fixed there. Also, just better documentation of using Intern with TypeScript would be very much appreciated.

Steps to reproduce (for bugs)

  1. Have running and passing tests
  2. Add "plugins": "node_modules/ts-node/register/index.js", to your intern.json
  3. Get TSError: ⨯ Unable to compile TypeScript:

Environment

Intern version: 4.8.7 Node version: 14.10 NPM version: 6.14.7 TypeScript version: 4.0.2 ts-node version: 9.0.0