-
Notifications
You must be signed in to change notification settings - Fork 190
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
Test coverage config adjustment #975
Conversation
Hi @4Source you've been really powering through the issues lately, great work! I haven't been very vocal lately, but have been busy on [FEAT] Refactor code to support diff methods of storing the scheduling info, and diff SR algorithms #878 FYI that has involved separating out more code to be unit testable. Cheers |
Thanks, thought less open bug would result in more time for the great ideas there are already here and waiting for implementation.
Great, then we can adjust the ignored files. What do you think about the global coverage threshold of 90% for now? |
@ronzulu Not sure it was your choice but found code that is edited by you. Why the use of the moments lib and not the Date from build in javascript? Because it seems the Moment lib has some issues with leap year. |
I just checked and the plugin version when I started being involved was 1.10.1. It already used the Moment lib, from package.json:
From memory I tried to standardize using it (instead of a mixture including raw Unix style times), but I didn't introduce it's usage. Hope that helps! Cheers |
Ok then I will go through the code and check it could be replaced with the default Date I think this should have no issues with leap years. But I will test this first. |
Hi @4Source
If a file is currently in the coverage list and someone modifies it without updating the unit tests, the coverage test will fail, which I think is good. If we change the global coverage threshold, I assume this means we lose that future protection. Is that how you see it? |
Yes this is indeed good I meant to reduce the amount of files there are currently on ignore because of |
I will add more tests to this branch to increase coverage when I have the time. |
As part of #878 I've had to separate out more code to be independent of the Do you know if jest can be configured for 100% coverage of specific files, and 95% across all the code? |
Yes this is possible. You can configure single files or folders |
# Conflicts: # src/util/utils.ts # tests/unit/util/utils.test.ts
# Conflicts: # jest.config.js # src/lang/locale/sw.ts # src/utils/utils.ts # tests/unit/sample-items.ts # tests/unit/utils/NumberCountDict.test.ts # tests/unit/utils/utils.test.ts
This reverts commit 17fe3f1.
|
46f7ca2
to
3f45042
Compare
Sorry I don't understand what this means. If it's related to the
I'm not too sure either. I've ran into the same discrepancies (the coverage is higher locally) yet the node versions & dependencies are the same locally & on the GitHub action 🤔. |
No, sorry, I should have made that clearer. Since I created the branch, the files have been renamed and Git on Windows seems to have trouble recognizing naming changes when it's just the case
Interesting |
# Conflicts: # jest.config.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have checked the config for jest and I have seen that the coverage is not really cover the full code so I adjusted the settings a bit to only include files there aren't testable because of include of obsidian api. Now the coverage looks different and we could improve on it.