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 distorted thinking and finding alternative modes of thought (i.e. reframing) while cognitive distortions are occurring. The CDJ does that work for you. -- The CDJ is in beta testing!!
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
.