Skip to content

Testing Guide

RushChat testing documentation.

Testing Overview

Test Types

Unit Tests

Test single functions or modules.

Integration Tests

Test collaboration between multiple modules.

End-to-End Tests

Test complete user flows.

Backend Testing

Run Tests

cd server-rust
cargo test

Write Tests

Add tests in Rust files:

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_function() {
        // Test code
    }
}

Frontend Testing

Run Tests

cd client
npm test

Write Tests

Using React Testing Library:

import { render, screen } from '@testing-library/react';
import Component from './Component';

test('renders component', () => {
  render(<Component />);
  expect(screen.getByText('Hello')).toBeInTheDocument();
});

Manual Testing

Feature Test Checklist

  • [ ] User registration and login
  • [ ] Send and receive messages
  • [ ] Create and join channels
  • [ ] Wallet connection
  • [ ] Red packet send and claim
  • [ ] Admin operations