Skip to content

Issue: Create Separate Test Database for Integration Testing #77

@agaesh

Description

@agaesh

Title: Create Separate Test Database for Integration Testing

Description:
Currently, our integration tests connect to the development database. To prevent accidental data changes and ensure isolated testing, we need to create a separate test database.

Tasks:

  • Add a test environment in config.js with separate credentials (EnrolNow_test).

  • Create the test database in MySQL:

    • Database name: EnrolNow_test
    • User: test_user (or same as dev user)
    • Grant privileges on the test database.
  • Update db.js to use NODE_ENV to select the correct database.

  • Update package.json test script: "test": "NODE_ENV=test vitest"

  • Verify that integration tests run against the test database and not the development database.

Acceptance Criteria:

  • Integration tests do not modify development database data.
  • Test database is created and ready to use with the project’s Sequelize setup.

Optional:

  • Create a Node.js helper script to automatically create the test database and sync tables before running tests.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions