Skip to content

Add basic test infrastructure with Jest and React Testing Library#63

Merged
docimin merged 3 commits intomainfrom
copilot/fix-62
Jun 20, 2025
Merged

Add basic test infrastructure with Jest and React Testing Library#63
docimin merged 3 commits intomainfrom
copilot/fix-62

Conversation

Copy link
Contributor

Copilot AI commented Jun 20, 2025

This PR adds a minimal testing setup to the project to establish a foundation for future test development.

Changes Made

  • Test Infrastructure: Added Jest configuration with Next.js integration and React Testing Library
  • Test Dependencies: Installed jest, @testing-library/react, @testing-library/jest-dom, and jest-environment-jsdom
  • Configuration Files:
    • jest.config.mjs - Jest configuration with Next.js support
    • jest.setup.js - Test setup file with jest-dom matchers
  • Test Scripts: Added test and test:watch scripts to package.json
  • Sample Tests: Created basic tests to demonstrate the setup:
    • src/__tests__/utils.test.ts - Tests for formatBytes and formatDate utility functions
    • src/__tests__/button.test.tsx - Tests for the Button component
  • Documentation: Updated README.md with testing instructions

Test Coverage

The initial tests cover:

  • Utility functions (formatBytes, formatDate) with various edge cases
  • UI component (Button) with different variants, sizes, and states
  • All 9 tests are passing successfully

Usage

# Run tests once
npm test

# Run tests in watch mode
npm run test:watch

This provides a solid foundation for adding more comprehensive tests as the project grows.

Fixes #62.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • fonts.googleapis.com
    • Triggering command: node /home/REDACTED/work/cloudnet-webinterface/cloudnet-webinterface/node_modules/.bin/next build (dns block)
  • o1.ingest.sentry.io
    • Triggering command: node /home/REDACTED/work/cloudnet-webinterface/cloudnet-webinterface/node_modules/.bin/next build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits June 20, 2025 09:51
Co-authored-by: docimin <30414906+docimin@users.noreply.github.com>
Co-authored-by: docimin <30414906+docimin@users.noreply.github.com>
Copilot AI changed the title [WIP] test Add basic test infrastructure with Jest and React Testing Library Jun 20, 2025
Copilot AI requested a review from docimin June 20, 2025 09:56
@docimin docimin marked this pull request as ready for review June 20, 2025 10:07
@docimin docimin merged commit 278170a into main Jun 20, 2025
2 checks passed
@docimin docimin deleted the copilot/fix-62 branch October 26, 2025 16:10
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.

test

2 participants