The Cognitive Distortion Journal (CDJ) is a smart journaling tool that helps remedy distorted thinking. It can feel impossible to follow the CBT technique of labeling and reframing distorted thinking when you've been thinking this way your whole life. The CDJ can help with that 🧠✨ -- v2 is in development!
This PR migrates db.js to TS, db.ts, and adds unit tests. The follow changes have been made
Updates import path in app.js.
Adds types to connectDB function signature.
Adds error handling to connectDB for undefined env variables. Adds unit tests with 94.11% coverage.
Unit test using production env variables is skipped to ensure consistency across development environments.
All unit tests pass using npm run test. The application runs in the container as expected and connects to the corresponding environment database using db.ts.
This PR migrates db.js to TS, db.ts, and adds unit tests. The follow changes have been made
app.js
.connectDB
function signature.connectDB
for undefined env variables. Adds unit tests with 94.11% coverage.All unit tests pass using
npm run test
. The application runs in the container as expected and connects to the corresponding environment database usingdb.ts
.