A
A
Abra Kadabra2018-04-17 16:09:17
JavaScript
Abra Kadabra, 2018-04-17 16:09:17

How to specify --type-check flag in Node and/or packages(tsc, ts-node)?

Hello. There is a problem with the Date reflection mechanism
in ts-node . To solve it, you need to set the `--type-check` flag. How can it be specified? If you simply specify in the console - tests are not processed, the typescript is not compiled. (tests on jest) . From the person working on ts-node, I got the answer: "you can use environment variables or if you're using by file you can use ts-node/register/type-check" Please tell me what kind of environment variable should I set? What is meant by if you're using by file you can use ts-node/register/type-check ?
ts-node --type-check my-file.test.ts

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Interface, 2018-04-17
@Jmaster

Can you please tell me what environment variable should I set?

As far as I can tell from the source ( https://github.com/TypeStrong/ts-node/blob/58b243c... ), you need to use the TS_NODE_TYPE_CHECK variable. They should update the readme.
You can work with ts-node through a normal node. If you include the ts-node/register module. Here you can find an example:
https://github.com/TypeStrong/ts-node#programmatic

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question