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

feat: add unit tests #25

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft

feat: add unit tests #25

wants to merge 4 commits into from

Conversation

Robert27
Copy link
Member

@Robert27 Robert27 commented Nov 22, 2024

This pull request introduces several changes, primarily focusing on adding new tests, updating dependencies, and enhancing the handling of manual campus life events in the database. Below is a summary of the most important changes:

New Tests Added:

  • Added tests for auth-utils to verify the behavior of the checkAuthorization function under various conditions.
  • Added tests for date-utils to ensure correct functionality of date manipulation functions such as formatISODate, getMonday, and addWeek.
  • Added tests for food-utils to validate functions like cleanMealFlags, capitalize, and unifyFoodEntries.

Dependency Updates:

  • Updated package.json to include new dependencies: @vitest/coverage-v8, vite-tsconfig-paths, and vitest. [1] [2]

Manual Campus Life Events:

  • Created a new table manual_cl_events to store manual campus life event details, including title, description, start and end dates, organizer, and URLs.
  • Added a new schema definition for manual_cl_events in manualClEvents.ts.
  • Implemented mutations for deleting (deleteManualClEvent) and upserting (upsertManualClEvent) manual campus life events. [1] [2]
  • Updated the clEvents query to combine Moodle events with manually added campus life events and cache the results.

Miscellaneous:

  • Replaced Bun.env.NODE_ENV with process.env.NODE_ENV in index.ts for consistency.
  • Added .returning() to delete mutations for consistency in returning deleted rows. [1] [2]

These changes collectively enhance the testing coverage, update dependencies, and improve the handling of manual campus life events in the application.

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.

1 participant