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

Added tests #1

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

Added tests #1

wants to merge 12 commits into from

Conversation

yozlet
Copy link

@yozlet yozlet commented Mar 7, 2025

I'd like to add a basic feature or two to the code, but I figured I should start with tests to ensure I don't break anything.

The test suite works in the browser - just open tests.html. However they also work on the command line (npm test)

yozlet added 11 commits March 7, 2025 10:52
- Introduced package.json with dev dependencies for Mocha, Chai, and JSDOM
- Added JSDOM setup in tests.js to enable testing in Node.js environment
- Updated tests to use JSDOM and improve cross-environment compatibility
- Added singleton instance clearing method to substitutionsViewModel
- Enhanced test coverage for substitutionsViewModel and fileViewModel
- Added localStorage mock for consistent testing across environments
- Updated Mocha setup in test.html with explicit configuration
- Enhanced localStorage persistence test for substitutionsViewModel
- Simplified localStorage testing approach in tests.js
- Updated test cases to parse more messages from sample Zoom chat
- Added test to verify markdown output filters direct messages
- Expanded test coverage for fileViewModel parsing logic
- Added test case for additional message in markdown rendering
- Improved test for direct message filtering in markdown output
- Verified markdown generation excludes direct messages
- Reorganized tests into logical describe blocks for better readability
- Added comprehensive HTML rendering tests for fileViewModel
- Introduced new test cases for HTML message structure and print view
- Removed redundant test cases and consolidated test coverage
- Added global variable comments for browser environment
- Implemented Node.js module exports in meet.js
- Updated file rendering to use document.createTextNode for safer text insertion
- Expanded JSDOM setup in tests.js with more robust configuration
- Added FileReader mock for testing
- Improved environment-specific initialization checks
@yozlet
Copy link
Author

yozlet commented Mar 8, 2025

Ack, realised that my test data is completely wrong. Hold please...

- Updated parsing logic to handle multiline messages with consistent formatting
- Refined message parsing to better handle "to Everyone" and direct message scenarios
- Improved content extraction for messages with multiple lines
- Updated test cases to validate new parsing behavior
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