Commit Graph

344 Commits

Author SHA1 Message Date
Ryan Mwangi 7bb3811a4d refactor: Move expected_output folder into temp_test_calendar
- Relocated the expected_output directory to temp_test_calendar for better organization.
- Simplified test structure by consolidating test-related files within the temporary directory.
- Improved clarity and maintainability of test resources.
2024-11-06 15:27:39 +03:00
Ryan Mwangi 8a522377c8 fix: Improve cleanup process in test suite
- Ensured the server is properly closed before executing cleanup.
- Added a delay to allow for the release of any lingering file handles.
- Enhanced the cleanup logic to safely remove the merged calendars directory after tests.
- Prevented potential EBUSY errors during directory removal.
2024-11-06 15:23:30 +03:00
Ryan Mwangi f5ff331f2f fix: Ensure correct merged calendars directory path based on environment
- Updated MERGED_CALENDARS_DIR to use path.join for consistent path resolution.
- Ensured that the directory is correctly set to 'temp_test_calendar' during tests and 'calendar' in production.
2024-11-06 15:20:24 +03:00
Ryan Mwangi 488106b299 test: Change the working directory to the test-specific directory 2024-11-06 15:03:34 +03:00
Ryan Mwangi e8dbc7a0b4 test: Isolate test environment by setting a temporary merged calendars directory 2024-11-06 15:01:33 +03:00
Ryan Mwangi d6a470237c feat(tests): implement whole output testing for calendar merging API 2024-11-05 16:02:59 +03:00
Ryan Mwangi 19af32da10 test(calendar.test.js): lead expected output 2024-11-05 15:57:10 +03:00
Ryan Mwangi 07eba543ae test(expected output): create folder with expected output 2024-11-05 15:54:50 +03:00
Ryan Mwangi 6d4944991c revert(tests): undo updates to URL assertions in calendar merging API tests 2024-11-05 15:30:41 +03:00
Ryan Mwangi 6bd83a7a56 fix(tests): update URL assertions in calendar merging API tests 2024-11-05 15:26:13 +03:00
Ryan Mwangi a2468b7dfb test(calendar.test.js):set us snapshot testing 2024-11-05 15:19:34 +03:00
Ryan Mwangi 6abaa4bd4b fix(server.js): Determine the merged calendars directory based on the environment 2024-11-05 14:47:25 +03:00
Ryan Mwangi f50c7a603b test (calendar.test.js): define temp_test_calendar in server 2024-11-05 14:41:39 +03:00
Ryan Mwangi 996623b3d7 test (calendar.test.js): Add logging 2024-11-05 14:32:53 +03:00
Ryan Mwangi 54d3a35c43 test (calendar.test.js): Check if the file was created in the test directory 2024-11-05 13:43:22 +03:00
Ryan Mwangi e44f8bf474 test (calendar.test.js): clean up TEST_MERGED_CALENDARS_DIR 2024-11-05 13:33:56 +03:00
Ryan Mwangi 0fc02c579d test(calendar.test.js):Ensure the test merged calendars directory exists 2024-11-04 21:21:58 +03:00
Ryan Mwangi b7a419f9cb test(calendar.test.js):Set environment variable for the test directory 2024-11-04 21:20:33 +03:00
Ryan Mwangi 5cfd0955f1 chore(server.js):Update Server Code to Use Environment Variable 2024-11-04 21:14:31 +03:00
ryanmwangi 17c3fb7b85 Merge pull request 'Formatting adjustment in tests' (#3) from janek/CalMerger:master into master
Reviewed-on: #3
2024-11-04 15:50:40 +00:00
xeruf d113975ef1 Formatting adjustment in tests 2024-11-04 16:35:10 +01:00
Ryan Mwangi f67594e072 update other offline calendar for time based events 2024-11-04 15:35:14 +03:00
Ryan Mwangi 4d58b51458 remove previous code for parsing calendar data using ical 2024-11-04 15:26:36 +03:00
Ryan Mwangi a752485d5e check if calendar is date based or event based in calendar/:name endpoint 2024-11-04 15:24:33 +03:00
Ryan Mwangi c264c6b842 parse calendar data in calendar/:name endpoint with ICAL 2024-11-04 15:23:21 +03:00
Ryan Mwangi c78b0501ea import ICAL from ical.js 2024-11-04 15:21:13 +03:00
Ryan Mwangi 79c5183971 check if calendar is date based or event based 2024-11-04 15:15:47 +03:00
Ryan Mwangi 698494dc27 import ical from ical.js in server.js 2024-11-04 15:08:47 +03:00
Ryan Mwangi e24f196491 install ical.js to use instead of ical as it's outdated 2024-11-04 14:30:09 +03:00
Ryan Mwangi 55287b9a75 Conditional Server Start in server.js for Test Environment 2024-11-04 14:23:09 +03:00
Ryan Mwangi 1631ba3478 Fetch calendar data from URL 2024-11-04 13:56:48 +03:00
Ryan Mwangi f677014cb1 add logging for catch error block 2024-11-04 13:51:49 +03:00
Ryan Mwangi d2f3afd9fa Read calendar data from local file 2024-11-04 13:51:00 +03:00
Ryan Mwangi 978ddb9ebc Check if calendar URL is a file path or a URL 2024-11-04 13:46:44 +03:00
Ryan Mwangi 3f3766138e update test calendars for calendars with the overide checked 2024-11-04 13:33:35 +03:00
Ryan Mwangi 910ffddddd update test calendars for calendars without a prefix 2024-11-04 13:32:10 +03:00
Ryan Mwangi 4142728d19 update test calendars for time based calendar 2024-11-04 13:30:08 +03:00
Ryan Mwangi 7f15fed11f add offline test calendars for time based calendar tests 2024-11-04 13:27:34 +03:00
Ryan Mwangi ba3c3c86ba edit syntax in Merge time-based calendar in calendar.test.js 2024-11-04 13:23:47 +03:00
Ryan Mwangi 8a0a5ce036 update test calendar for US_holidays in date based calendars 2024-11-04 13:21:25 +03:00
Ryan Mwangi 91f86c3f3e update test calendar for date based calendar 2024-11-04 13:20:05 +03:00
Ryan Mwangi 83ea893da0 load offline calender files 2024-11-04 13:12:44 +03:00
Ryan Mwangi d2c42836b9 define TEST_CALENDAR_DIR in calendar.test.js 2024-11-04 13:10:43 +03:00
Ryan Mwangi b810b35673 remove ical-generator import in calendar.test.js 2024-11-04 13:09:34 +03:00
Ryan Mwangi e73c8f574a have a directory for offline .ics files 2024-11-04 13:05:08 +03:00
Ryan Mwangi 9b15715337 document how to run the tests 2024-11-04 02:02:30 +03:00
Ryan Mwangi f374eefbec remove unused merged calendar.txt file 2024-11-01 18:32:46 +03:00
Ryan Mwangi 6eb9d29d44 make tests to run on calendar directory 2024-10-31 15:46:44 +03:00
Ryan Mwangi c4e77ccc4d add calendar link to time based event test 2024-10-31 15:43:13 +03:00
Ryan Mwangi 5b24f1b016 add calendar link to date based event test 2024-10-31 15:41:08 +03:00