Add e2e test

From uxname/liteend · View interactive version

Add e2e test is an AI agent skill from the GitHub repository uxname/liteend. Create an End-to-End (E2E) test for a REST controller or GraphQL resolver using Fastify injection.

How to use this skill

Skill file

Rules

  1. Never import supertest.
  2. Use E2EClient and createTestingApp from test/utils/testing-app.ts.
  3. Do not import describe, it, expect, beforeAll, etc. from 'vitest', as they are globally available.

Template for REST:

import { E2EClient } from '../../test/utils/e2e-client';
import { createTestingApp } from '../../test/utils/testing-app';

describe('FeatureName (e2e)', () => {
  let client: E2EClient;

  beforeAll(async () => {
    const { fastify } = await createTestingApp();
    client = new E2EClient(fastify);
  });

  it('should process request and return 200', async () => {
    // Arrange
    // Act
    const response = await client.request({ method: 'GET', url: '/api/path' });
    // Assert
    expect(response.statusCode).toBe(200);
  });
});
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.