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

type-coverage -p command yielding different results from different root directories #123

Closed
spaul1042 opened this issue May 23, 2023 · 8 comments
Labels
question Further information is requested

Comments

@spaul1042
Copy link

Version(if relevant): 1.0.0

Environment(if relevant):

Vs code , React Typescript based project

Code(if relevant):

// code here

Expected:

I have a packages folder where there are different packages whose type-coverage rate I want to calculate. There is a package named "board" and another package named "proto".

I am testing the type-coverage commands on these two terminals.
In Terminal 1 , I am in >> src/packages/
In Terminal 2 , I am in >> src/packages/proto

Command I run on Terminal 1 : type-coverage -p board
Command I run on Terminal 2 : type-coverage -p ../board

I must get the same type coverage rate in bot the terminals.

Actual:

On Terminal 1 I get >> 396027/40714, 97.27 %
On Terminal 2 I get >> 608/662. 91.84 %

Am I missing something here as the type-coverage command is installed globally.

@spaul1042 spaul1042 changed the title type-coverage -p command yielding different results from different root directoreis type-coverage -p command yielding different results from different root directories May 23, 2023
@plantain-00
Copy link
Owner

The result in files start with .. will be ignored, to fix #42 :

if (file.startsWith('..')) {
continue
}

@plantain-00 plantain-00 added the question Further information is requested label May 23, 2023
@spaul1042
Copy link
Author

spaul1042 commented May 24, 2023

I want to run type-coverage commands from script file of a directory named type-coverage present in the script directory. and script folder is there in the root of the project. do you suggest something that I can do?

@spaul1042
Copy link
Author

The result in files start with .. will be ignored, to fix #42 :

if (file.startsWith('..')) {
continue
}

@spaul1042 spaul1042 reopened this May 24, 2023
@plantain-00
Copy link
Owner

Maybe your script can be like something cd .. && type-coverage -p ./src

@spaul1042
Copy link
Author

spaul1042 commented May 24, 2023

My issue got resolved, I had to change my cwd in the script file. But please look into this that the command not working when I cd into a particular package of the packages directory , and then run type-coverage -p . Even this yielding a different answer.

plantain-00 added a commit that referenced this issue May 24, 2023
@plantain-00
Copy link
Owner

v2.26.0 add --not-only-in-cwd to disable this behavior.

@spaul1042
Copy link
Author

Okay thanks!

@spaul1042
Copy link
Author

spaul1042 commented May 25, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants