Skip to content

Add Testing Infrastructure and Test Coverage #1 - #14

Open
divyanshbhai wants to merge 9 commits into
usarfoss:mainfrom
divyanshbhai:fix-issue-1
Open

Add Testing Infrastructure and Test Coverage #1#14
divyanshbhai wants to merge 9 commits into
usarfoss:mainfrom
divyanshbhai:fix-issue-1

Conversation

@divyanshbhai

Copy link
Copy Markdown

Fix #1

This PR implements a comprehensive testing infrastructure for the drawDB project.

Changes Made:

  • ✅ Added Vitest testing framework with jsdom environment
  • ✅ Created 19 passing tests covering utilities, components, and hooks
  • ✅ Added GitHub Actions CI workflow for automated testing
  • ✅ Comprehensive documentation in TESTING.md
  • ✅ Coverage reporting with v8 provider
  • ✅ Test utilities and mock data generators

Testing:

  • All tests pass: 19/19 ✅
  • Coverage reports generated
  • CI workflow validates on Node.js 18.x and 20.x

Scripts Added:

  • npm run test - Watch mode
  • npm run test:run - Single run
  • npm run test:coverage - With coverage
  • npm run test:ui - UI mode

Divyansh added 9 commits October 15, 2025 17:42
- Add vitest.config.js with jsdom environment
- Add test setup file with testing-library configuration
- Add testing dependencies: vitest, @testing-library/react, jsdom
- Add test scripts: test, test:ui, test:run, test:coverage
- Add tests for arrayIsEqual, strHasQuotes, isKeyword, isFunction
- Add tests for getTableHeight function
- Cover edge cases and validation scenarios
- Add Navbar component tests with navigation and mobile menu functionality
- Add Thumbnail component tests with mocked dependencies
- Include proper mocking for external dependencies
- Add tests for useFullscreen hook with fullscreen state management
- Add tests for useThemedPage hook with DOM manipulation
- Include proper mocking for external dependencies and DOM APIs
- Add test workflow that runs on push and pull requests
- Test against Node.js 18.x and 20.x versions
- Include linting, testing, and coverage reporting
- Upload coverage reports to Codecov
- Add TESTING.md with detailed testing guide and best practices
- Configure coverage reporting with v8 provider
- Update gitignore to exclude coverage files
- Include examples for component, hook, and utility testing
- Add renderWithRouter utility for testing components with routing
- Add mock data generators for tables and diagrams
- Add integration tests for app-level functionality
- Include helper functions for common testing patterns
- Add testing section with available npm scripts
- Reference TESTING.md for detailed testing guide
- Include commands for watch mode, single run, coverage, and UI
- Fix useThemedPage test by properly mocking dependencies
- Simplify component tests to avoid complex dependency issues
- Remove JSX syntax from integration tests to fix parsing errors
- All tests now pass successfully (19/19 tests passing)
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.

Add Testing Infrastructure and Test Coverage

1 participant