Shop-Admin/integration-tests/http
Yen Nguyen f4b8d91524 init setup 2025-10-16 17:28:13 +02:00
..
README.md init setup 2025-10-16 17:28:13 +02:00
health.spec.ts init setup 2025-10-16 17:28:13 +02:00

README.md

Integration Tests

The medusa-test-utils package provides utility functions to create integration tests for your API routes and workflows.

For example:

import { medusaIntegrationTestRunner } from "medusa-test-utils"

medusaIntegrationTestRunner({
  testSuite: ({ api, getContainer }) => {
    describe("Custom endpoints", () => {
      describe("GET /store/custom", () => {
        it("returns correct message", async () => {
          const response = await api.get(
            `/store/custom`
          )
  
          expect(response.status).toEqual(200)
          expect(response.data).toHaveProperty("message")
          expect(response.data.message).toEqual("Hello, World!")
        })
      })
    })
  }
})

Learn more in this documentation.