Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds ts-node/register/transpile-only as require option #415

Closed
wants to merge 1 commit into from

Conversation

godu
Copy link

@godu godu commented Jun 5, 2019

istanbuljs/nyc#1124 (comment)

When we enable nyc.all option, nyc need to transpile source in the same way as the test runner (mocha or ava in my case).

If we add --require ts-node/register/transpile-only as default configuration for typescript, --all will work out of the box.

@coreyfarrell
Copy link
Member

I don't think this can be in the preset as some people might want to use ts-node/register (not transpile-only).

Maybe it would be better to just update the documentation to suggest the require in nyc config instead of mocha config? @JaKXz this more your area so I'll defer to your judgement for how to handle this.

@godu
Copy link
Author

godu commented Jun 5, 2019

Do someone realy want to use ts-node/register instead of ts-node/register/transpile-only ?
We only only the transpiler part of typescript here. It will be more efficient I think.

What uses --require apart from to transpile source when --all is enabled ?

@coreyfarrell
Copy link
Member

What uses --require apart from to transpile source when --all is enabled ?

This also causes sources to be processed when actually running the tests.

@JaKXz
Copy link
Member

JaKXz commented Jun 5, 2019

@godu the reason I'm against this is that the default mocha setup does not need nyc to require ts-node at all - unless this has changed recently, I would rather leave it so that people don't have to do

"extends": "@istanbuljs/nyc-config-typescript",
"require": []

@godu
Copy link
Author

godu commented Jun 5, 2019

@JaKXz seems legit

I rework my PR to add some documentation about require. Tell me if you have any others requirements.

@JaKXz
Copy link
Member

JaKXz commented Jun 5, 2019

@godu I appreciate that, but I don't think this adds any value to the package README, since it already mentions an .nycrc file.

@JaKXz JaKXz closed this Jun 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants