TestyTs
TestyTs copied to clipboard
Support for .js files without internal TypeScript compilation
Hi,
I'm currently using a beta feature from TypeScript 4.1 beta, which has a new flag in tsconfig.json called noUncheckedIndexedAccess
.
ts-node doesn't understand this yet, which is evident when I try to run testyts
:
Error: "⨯ Unable to compile TypeScript:
error TS5023: Unknown compiler option 'noUncheckedIndexedAccess'."
Is it possible to use an external tsc --watch
process and just point testyts at the compiled .js files?
Being able to do this would help with another issue that I'm having with ts-node.
I'm including .js
at the end of the filenames in my import/require statements. ts-node does not understand this neither. It complains that it cannot find the file. However, adding .js
at the end of filenames is the only way to do it if you use native ES modules (without bundling) in the browser. Browsers are not in a situation where they can magically append various file extensions and make GET requests until they find the correct file name.
Here's the ts-node issue on the topic: https://github.com/TypeStrong/ts-node/issues/783 They closed the issue saying that Microsoft has to implement a workaround in TypeScript. However, Microsoft has indicated that they don't want to rewrite import paths. Thus resulting in a stalemate.
In summary, ts-node is off-limits for me due to a variety of unsupported features.
Another issue I noticed is that TestyTS currently seems to force TypeScript 3.9 for ts-node compilation, even though the stable version of 4.0 has been released already.
Being able to compile TypeScript files externally should probably resolve this as well.
Hi! I somehow didn't get notified you created an issue! I'll take a clsoe look at this as soon as possible. If you would like to make a pull request and fix this, that would also be welcome!
Hello! Just a quick update: I haven't had time to take a look at this in particular because I've been working on setting up integration tests. Now that that's done, I should be able to make a repro and fix this.
Hi,
The latest beta version of TestyTs, 2.0.0-beta.5, now comes with the latest version of ts-node. This should fix the noUncheckedIndexedAccess
issue.
Thanks!