Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 60 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,71 @@ The following is a set of guidelines for contributing to our project. These are
- [Reporting Bugs](#reporting-bugs)
- [Suggesting Enhancements](#suggesting-enhancements)
- [Submitting Pull Requests](#submitting-pull-requests)
2. [Style Guides](#style-guides)
2. [Development Setup](#development-setup)
- [Running Tests](#running-tests)
- [Style Guide](#style-guide)
3. [Testing Guidelines](#testing-guidelines)
- [Writing Tests](#writing-tests)
- [Running Tests](#running-tests)
4. [Style Guides](#style-guides)
- [Git Commit Messages](#git-commit-messages)
- [Style Guide](#style-guide)
3. [Additional Notes](#additional-notes)
5. [Additional Notes](#additional-notes)
- [Issue and Pull Request Labels](#issue-and-pull-request-labels)
- [Getting Help](#getting-help)

## Development Setup

### Running Tests

The project uses Vitest as the testing framework along with React Testing Library for component testing. To run tests:

```bash
# Run tests once
npm test

# Run tests in watch mode (recommended during development)
npm run test:watch

# Run tests with coverage report
npm run test:coverage
```

## Testing Guidelines

### Writing Tests

We use Vitest and React Testing Library for testing. When writing tests:

1. Place test files next to the code they're testing with a `.test.jsx` or `.test.js` extension
2. Test components using React Testing Library's user-centric queries
3. Follow the Arrange-Act-Assert pattern in your tests
4. Mock external dependencies and complex browser APIs
5. Focus on testing behavior rather than implementation details

Example of a component test:

```jsx
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import YourComponent from './YourComponent';

describe('YourComponent', () => {
it('should render correctly', () => {
render(<YourComponent />);
expect(screen.getByRole('button')).toBeInTheDocument();
});
});
```

### Test Coverage

We strive to maintain good test coverage for our codebase. When submitting a pull request:

1. Ensure your changes are covered by tests
2. Run the test coverage report (`npm run test:coverage`)
3. Address any significant gaps in coverage

## How Can I Contribute?

### Reporting Bugs
Expand Down
Loading