Closed hiyaryan closed 2 months ago
Overall it's looking really good! Great job! The main thing is I want to make sure we understand what the babel typescript preset does and doesn't do, and confirm that it fits our needs. The rest of the review is a couple of questions I had and edits I think would be helpful.
Awesome! Thank you for the reviews @davidzlu. I should have resolved and responded to all of them. Most importantly, I added type checking to the tests and removed that pesky extra whitespace. Please have a look and let me know what you think!
This PR sets up the initial TS Jest testing environment and uses mongodb-memory-server. The following changes were made (also in commit body) in order to allow Jest to understand TypeScript. A test has been made for
index.ts
that itself tests this setup. Additionally, some minor changes have been added, adding/updating comments in the files worked on and including a graceful shutdown inindex.ts
.Updated
package.json
:tsc --watch
instead oftsx watch
.@babel/preset-typescript
,@types/express
,@types/jest
,mongodb-memory-server
, andts-node
.Modified
db.js
:mongoose
.mongoose
asdb
to ensure consistent type definitions.Updated
index.ts
:process.on
to listen for SIGINT and SIGTERM signals.Created
index.test.ts
:Modified Jest setup and teardown scripts: