Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/lambda-curry/medusa2-starterWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/lambda-curry/medusa2-starter/testing-patterns-integration)<a href="https://agentmods.dev/rules/lambda-curry/medusa2-starter/testing-patterns-integration"><img src="https://agentmods.dev/badge/rules/lambda-curry/medusa2-starter/testing-patterns-integration/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/lambda-curry/medusa2-starter/testing-patterns-integration"><img src="https://agentmods.dev/badge/rules/lambda-curry/medusa2-starter/testing-patterns-integration.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01184 | $0.01184 |
| Opus 5.5 | $0.00474 | $0.00474 |
| Sonnet 5.5 | $0.00237 | $0.00237 |
| Haiku 4.5 | $0.00118 | $0.00118 |
Grade A, and why
testing-patterns-integration scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 15d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 185 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Integration Testing Patterns for Medusa Applications
You are an expert in integration testing TypeScript applications, focusing on testing how different parts of the system work together in Medusa and React applications.
Core Testing Principles
- Write tests that verify interactions between different system components
- Test real integrations with databases, APIs, and external services
- Use descriptive test names that explain the integration being tested
- Arrange, Act, Assert (AAA) pattern for test structure
- Test realistic scenarios and data flows
- Use proper test data setup and cleanup
- Ensure tests are isolated and can run independently
Integration Testing
API Route Testing
// api/__tests__/products.test.ts
import { createMedusaContainer } from "@medusajs/framework/utils"
import { medusaIntegrationTestRunner } from "@medusajs/test-utils"
medusaIntegrationTestRunner({
testSuite: ({ getContainer, api }) => {
describe("Products API", () => {
let container: MedusaContainer
beforeEach(() => {
container = getContainer()
})
describe("GET /admin/products", () => {
it("should return list of products", async () => {
// Arrange - create test data
const productService = container.resolve("productService")
await productService.create({
title: "Test Product",
handle: "test-product",
})
// Act
const response = await api.get("/admin/products")
// Assert
expect(response.status).toBe(200)
expect(response.data.products).toHaveLength(1)
expect(response.data.products[0].title).toBe("Test Product")
})
it("should filter products by title", async () => {
// Arrange
const productService = container.resolve("productService")
await productService.create({
title: "Product A",
handle: "product-a",
})
await productService.create({
title: "Product B",
handle: "product-b",
})
// Act
const response = await api.get("/admin/products?q=Product A")
// Assert
expect(response.status).toBe(200)
expect(response.data.products).toHaveLength(1)
expect(response.data.products[0].title).toBe("Product A")
})
})
describe("POST /admin/products", () => {
it("should create a new product", async () => {
// Arrange
const productData = {
title: "New Product",
handle: "new-product",
description: "A new product",
}
// Act
const response = await api.post("/admin/products", productData)
// Assert
expect(response.status).toBe(201)
expect(response.data.product.title).toBe(productData.title)
expect(response.data.product.handle).toBe(productData.handle)
})
it("should return validation error for invalid data", async () => {
// Arrange
const invalidData = {
title: "", // Empty title should fail validation
}
// Act
const response = await api.post("/admin/products", invalidData)
// Assert
expect(response.status).toBe(400)
expect(response.data.errors).toBeDefined()
})
})
})
},
})
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 15d ago First seen · 185 lines · 1,184 tokens per session scan A 3f8c744178fb
testing-patterns-integration is a cursor rule published in the GitHub repository lambda-curry/medusa2-starter (164 stars, last pushed 17d ago), licensed MIT. It adds 1,184 tokens to every session, about $0.0047 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-15.
testing-patterns-integration compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| testing-patterns-integrationlambda-curry/medusa2-starter | Cursor rule | 164 | 17d ago | MIT | A | 1,184 | Cursor |
| djangosanjeed5/awesome-cursor-rules-mdc | Cursor rule | 3.6k | 7d ago | CC0-1.0 | A | 2,043 | Cursor |
| api-property-optionality-hygienenovuhq/novu | Cursor rule | 40k | today | none | A | 0 | Cursor |
| pythonPatrickJS/awesome-cursorrules | Cursor rule | 41k | 6mo ago | CC0-1.0 | A | 734 | Cursor |
| cursormrwogu/promptscript | Cursor rule | 324 | 7d ago | MIT | A | 53 | Cursor |
| gosupertokens/create-supertokens-app | Cursor rule | 24 | 3d ago | Apache-2.0 | A | 0 | Cursor |
| ehs-ims-conventionsSafetyMP/Autonomous-EHS-Management | Cursor rule | 9 | yesterday | Apache-2.0 | A | 722 | Cursor |