Skip to content

feat(testing): add idempotent test-database seeding script and integration tests (#394) - #531

Open
tomasbogado203-bit wants to merge 1 commit into
AudioBitsStellar:mainfrom
tomasbogado203-bit:feat/test-db-seeding-script
Open

feat(testing): add idempotent test-database seeding script and integration tests (#394)#531
tomasbogado203-bit wants to merge 1 commit into
AudioBitsStellar:mainfrom
tomasbogado203-bit:feat/test-db-seeding-script

Conversation

@tomasbogado203-bit

Copy link
Copy Markdown

Summary

Resolves #394 by adding an idempotent test-database seeding script (src/seeders/test.seeder.ts), npm scripts (
pm run seed:test,
pm run db:seed:test), production safety guards, and integration test coverage ( ests/integration/testSeeder.integration.test.ts).

Features

  • Idempotent Test Seeder (src/seeders/test.seeder.ts):
  • Safety Guards:
    • �ssertTestEnvironmentSafety() blocks execution when NODE_ENV=production unless explicitly allowed via ALLOW_TEST_SEED=true.
  • NPM Scripts:

pm run seed:test and
pm run db:seed:test.

  • Integration Tests ( ests/integration/testSeeder.integration.test.ts):
    • Verifies safety guards against production mode.
    • Verifies seeded entity counts and relationships.
    • Verifies multi-execution idempotency.
  • Documentation:
    • Updated README.md with script usage and descriptions.

Verification

px jest tests/integration/testSeeder.integration.test.ts --runInBand (5/5 tests passing)

  • Lint and Prettier pre-commit hooks passed.

…ation tests (AudioBitsStellar#394)

Signed-off-by: tomasbogado203-bit <tomasbogado203@gmail.com>
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 a test-database seeding script for local integration testing

1 participant