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

Adding unit testing to paperless-ai #186

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

fernanfs
Copy link

During preparations on contributing to paperless-ai, I've discovered, that there is a lack of unit testing.
Unit testing makes contributions easier and avoids regressions. In addition, it makes the intention of methods/functions clear by providing test cases, detailling the input parameters and output expectations.

This pull request:

  • adds jest as a dependency for unit testing
  • renames the existing run target test to dev. Starting the development instance can now be done by npm run dev, which is common to most node based applications
  • adds a run target test which executes the unit tests
  • Adds a number of testcases as a first starting point

These are the very first testcases to introduce testing in paperless-ai
Fixed the implementation, due to a bug in the loading logic. The logic was unable to load multiline strings
Fixed the implementation, due to a bug in the writing logic not handling the multiline string as supported by dotenv
@clusterzx
Copy link
Owner

This pull request has been marked as stale due to inactivity. Please update it to keep it open.

@fernanfs
Copy link
Author

Hey @clusterzx !
Is there anything I should add to make this worth merging? I'd like to contribute more content, but would like to have the chance of incorporating unit tests for those changes.

@clusterzx clusterzx removed the stale label Jan 30, 2025
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