Skip to content

Add HTTPYac Tests for Entity Endpoints in NestJS #146

Description

@onlydustapp

🚀 Overview

We need to create HTTPYac test files for each of the following entities in our NestJS backend: admin, analytics, blockchain, leaderboard, offline-quiz, quiz, and starknet. These files are intended to help us manually and automatically test our API using the HTTPYac CLI or VS Code plugin.

🎯 Objectives

  • Create .http test files for each entity under the http-tests/ folder.
  • Ensure that each endpoint (GET, POST, PATCH, DELETE) has at least 3 sample HTTP requests per module.
  • Include example payloads based on the module’s Controller routes, DTOs, and service logic.
  • Use variables for baseUrl and optionally for token (auth) where applicable.
  • Add comments or names to each request for clarity and document the expected results.

📝 Detailed Requirements

  1. Setup

    • Use npm ci instead of npm install when setting up the project to avoid dependency mismatches.
  2. HTTPYac Files

    • Place the test files in the following structure:

      http-tests/
        admin.http
        analytics.http
        blockchain.http
        leaderboard.http
        offline-quiz.http
        quiz.http
        starknet.http
      
  3. Test Content

    • For each module, create at least 3 sample HTTP requests covering various operations (GET, POST, PATCH, DELETE) and include:
      • An example payload for the request, referencing the DTOs as needed.
      • Variables for baseUrl (and optionally token) to ensure reusability of the tests.
      • Clear comments for each request indicating the purpose or expected result.

⚙️ Technical Considerations

  • Familiarize yourself with each module by reviewing its Controller, DTOs, and service logic.
  • Ensure that the tests are runnable with HTTPYac (CLI or VS Code plugin).

✅ Acceptance Criteria

  • Each entity has a corresponding .http file in the http-tests/ folder.
  • At least 3 sample requests per module, each with clear comments and necessary variables.
  • Tests are verified to be runnable via HTTPYac.

Let's ensure our API endpoints are thoroughly tested with these HTTPYac files! 🎉

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions