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.
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
testenvironment inconfig.jswith separate credentials (EnrolNow_test).Create the test database in MySQL:
EnrolNow_testtest_user(or same as dev user)Update
db.jsto useNODE_ENVto select the correct database.Update
package.jsontest script:"test": "NODE_ENV=test vitest"Verify that integration tests run against the test database and not the development database.
Acceptance Criteria:
Optional: