DesignMint
  • DesignMint Designer Docs
  • DesignMint Medusa Monorepo Setup
  • admin
    • integration-tests
      • Integration Tests
    • src
      • Admin Customizations
      • Custom API Routes
      • Custom scheduled jobs
      • Module Links
      • Custom Module
      • Custom CLI Script
      • Custom subscribers
      • Custom Workflows
  • storefront
  • DesignMint License Notice
Powered by GitBook
On this page
  1. admin
  2. integration-tests

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!")
        })
      })
    })
  }
})
Previousintegration-testsNextsrc

Last updated 18 days ago

Learn more in .

this documentation