-
Notifications
You must be signed in to change notification settings - Fork 157
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
Updated tests #684
Draft
Gramatus
wants to merge
23
commits into
github:main-enterprise
Choose a base branch
from
Gramatus:tests
base: main-enterprise
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Updated tests #684
+1,163
−184
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@decyjphr does this look promising? It might be a few weeks before I can continue, but if this is interesting I will try to make sure all the tests in this PR works and does what is expected. |
These were added as part of understanding the code, commiting in case they might be useful for others as well.
This is what probot actually uses to identify the org, so it should probably be there in the fixture.
When `sender.type` is bot, the change is skipped. This led to the test checking for changes on this event failing.
This seems to me to be the best way for logs to show up in a useful fashion when running tests.
This is needed for the test to be able to check that it was called.
Also adds support for ovveriding the filter list in `Diffable.sync`. This is needed for milestones to work correctly. However, it should be tested well to ensure it does not break anything else.
I believe this change makes the logic easier to follow, especially not returning data that does not need to be returned.
This change should give the exact same result, except moving the `else`-block within the try/catch (and I don't see why that is bad). The refactor makes it easier to understand the difference in logic with and without a present `repoConfig` by only having the actual alternate action within the if/else and keeping the bit that always happen outside the if/else.
Linting failed in deploymentConfig.js due to the static fields. Eslint supports this from ecmaVersion 13.
The full test suite failed because it tried to lint the tests, while the running linter did not do the same. Enabling linting gave errors due to jest having undef stuff, but overriding these files for jest env keeps the linting without these errors.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is so far a WiP, but I am trying to see if I can get those tests that are currently skipped to work.
I have managed to run all the tests in
index.test.js
,branches.test.js
andmilestones.test.js
, but I am not completely certain that all the tests actually checks what they should. I will try to look into that later. I believe this is still a good way towards better testing.One important thing to note is that I added
title
toMergeDeep.NAME_FIELDS
in order to make milestones work. I am not sure if this might have unintended consequences, and would be happy if someone else has any insights into that.I also added a few JSDoc types (for my own understanding of the code), hopefully that is not a problem.
Finally, I fixed a few places where I believe the logging was wrong (see 6f205c3).