Skip to content

Test for edit package #3063

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

Merged
merged 1 commit into from
Apr 28, 2022
Merged

Test for edit package #3063

merged 1 commit into from
Apr 28, 2022

Conversation

mortent
Copy link
Contributor

@mortent mortent commented Apr 27, 2022

This adds a unit test for the editPackageMutation. I'm looking to add some additional tests for error conditions, but want to verify the approach first.

This required adding stub implementations of several interfaces. I'm open to ideas about how we can make this easier.

Copy link
Contributor

@martinmaly martinmaly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like an approach worth trying.
So far we have been testing mostly with real repositories (see git_test or e2e_test) but I think we need to try some lower-level unit tests and this seems like a good way to go about it.

I imagine that the fake repository can be extracted into a reusable test building block. Then we can see whether using (and maintaining it) is more work than using Git repository directly. We have pretty comprehensive utilities built around the git repositories which make it very easy to spin up, seed the repositories with initial state, and then perform tests.

@mortent mortent merged commit 4cf59cd into kptdev:main Apr 28, 2022
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.

2 participants