Skip to content

Feat/test#651

Open
nafiuishaaq wants to merge 3 commits into
MettaChain:mainfrom
nafiuishaaq:feat/test
Open

Feat/test#651
nafiuishaaq wants to merge 3 commits into
MettaChain:mainfrom
nafiuishaaq:feat/test

Conversation

@nafiuishaaq
Copy link
Copy Markdown
Contributor

Done

What changed

  • Added prisma-test-helpers.ts

    • createTestPrismaClient()
    • cleanupDatabase(prisma)
    • resetTestDatabase(prisma, seedFn?)
    • withDatabaseCleanup(fn)
  • Added prisma-test-helpers.spec.ts

    • demonstrates seeded data reset between tests
    • verifies created records are cleaned after each test
    • uses TEST_DATABASE_URL / DATABASE_URL for database-backed test execution
  • Stabilized a flaky test in api.spec.ts

    • removed strict timing assertions
    • now verifies correct analytics and cache hit behavior instead of wall-clock performance
  • Updated README.md

    • added note about TEST_DATABASE_URL
    • referenced the new DB fixture helpers

Why this meets acceptance

  • Created records are cleaned after tests via cleanupDatabase
  • Seeded fixture state is reset between suites through resetTestDatabase
  • Helper utilities now directly support cleanup and reset
  • Flaky time-sensitive tests were audited and refactored for stability

Made changes.

Closes #613
closes #615

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 31, 2026

@nafiuishaaq Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add test fixture cleanup for seeded database tests Add critical module code coverage thresholds

1 participant