fix: standardize database credentials with environment variables and …#100
Merged
Julien-R44 merged 1 commit intoJulien-R44:mainfrom Dec 26, 2025
Merged
fix: standardize database credentials with environment variables and …#100Julien-R44 merged 1 commit intoJulien-R44:mainfrom
Julien-R44 merged 1 commit intoJulien-R44:mainfrom
Conversation
…refine test group names
|
a3989a6 to
c876b72
Compare
Owner
|
Thanks ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR refactors the test suite to improve reliability, maintainability, and developer experience. The changes address Node.js compatibility issues, centralize database configuration, improve test cleanup behavior, and standardize test naming conventions.
Summary of Changes
1. Fix Node.js Compatibility in File Driver
Fixed a crash in the file driver’s cache pruning logic when running on Node.js versions prior to v20.12.0.
Older Node.js versions do not expose the
parentPathproperty onfs.Direntobjects, which caused path resolution to fail during pruning.Before
After
This ensures compatibility across all supported Node.js versions.
2. Centralize Database Credentials
Database credentials are now configured via environment variables instead of being hardcoded in individual test files.
Changes made
Added centralized exports:
MYSQL_CREDENTIALSPOSTGRES_CREDENTIALSin:
Updated
.env.examplewith all supported configuration optionsRefactored all database driver tests to import credentials from the shared helpers module
3. Improve Test Cleanup Reliability
Replaced manual
disconnect()calls with Japa’scleanup()hook to ensure resources are released even when tests fail.Before
After
4. Standardize Test Group Naming
Applied consistent sentence-case naming conventions across all test groups.
Examples:
Redis driverKnex | Postgres driverKysely | Mysql driverOutcome