nitishragu12 / Capstone-Project

0 stars 1 forks source link

Setup Test Environment for Frontend and Backend #51

Closed maxtse25 closed 1 month ago

maxtse25 commented 2 months ago

We need to establish a testing environment for our application to ensure that both the frontend (React) and backend (Flask) are properly tested. This will involve configuring the necessary tools and scripts to run unit and integration tests efficiently.

Frontend (React):

  1. Testing Frameworks:

    • [ ] Install and configure Jest for unit testing.
    • [ ] Install and configure React Testing Library for component testing.
  2. Configuration Files:

    • [ ] Create or update jest.config.js for Jest configuration.
    • [ ] Set up setupTests.js if needed for React Testing Library.
  3. Environment Variables

    • [ ] Create a .env.test file for test-specific environment variables.
  4. Test Scripts:

    • [ ] Add or update test scripts in package.json: "scripts": { "test": "jest", "test:watch": "jest --watch", "test:coverage": "jest --coverage" }
  5. Docker Configuration:

    • [ ] Dockerfile: Ensure the Dockerfile for the frontend includes necessary dependencies for testing.

Backend (Flask):

  1. Testing Frameworks:

    • [ ] Install and configure pytest for unit and integration testing.
    • [ ] Install and configure Flask-Testing if needed for Flask-specific testing utilities.
  2. Configuration Files:

    • [ ] Create or update pytest.ini for pytest configuration.
    • [ ] Ensure test configuration is included in the Flask application setup.
  3. Test Scripts:

    • [ ] Add or update test scripts in setup.py or relevant files: pytest --maxfail=1 --disable-warnings -q
  4. Docker Configuration:

    • [ ] Dockerfile: Ensure the Dockerfile for the frontend includes necessary dependencies for testing.

Tasks:

Additional Notes: