diff --git a/backend/typescript/models/user.model.ts b/backend/typescript/models/user.model.ts index 051764f..3cb36ce 100644 --- a/backend/typescript/models/user.model.ts +++ b/backend/typescript/models/user.model.ts @@ -15,7 +15,7 @@ export default class User extends Model { @Column({ type: DataType.STRING }) auth_id!: string; - @Column({ type: DataType.INTEGER }) + @Column({ type: DataType.INTEGER, primaryKey: true }) id!: number; @Column({ type: DataType.ENUM("User", "Admin") }) diff --git a/backend/typescript/nodemailer.config.ts b/backend/typescript/nodemailer.config.ts index 35ddd37..4e1dc02 100644 --- a/backend/typescript/nodemailer.config.ts +++ b/backend/typescript/nodemailer.config.ts @@ -1,5 +1,7 @@ +import dotenv from "dotenv"; import { NodemailerConfig } from "./types"; +dotenv.config(); const config: NodemailerConfig = { service: "gmail", auth: { diff --git a/backend/typescript/package.json b/backend/typescript/package.json index fbb1954..cd06eb6 100644 --- a/backend/typescript/package.json +++ b/backend/typescript/package.json @@ -4,7 +4,7 @@ "description": "", "main": "server.ts", "scripts": { - "test": "jest --runInBand --forceExit --detectOpenHandles", + "test": "jest --runInBand --forceExit", "dev": "nodemon -L", "lint": "eslint . --ext .ts,.js", "fix": "eslint . --ext .ts,.js --fix", @@ -24,7 +24,7 @@ "apollo-server-express": "^2.22.2", "cookie-parser": "^1.4.5", "cors": "^2.8.5", - "dotenv": "^8.2.0", + "dotenv": "^16.0.3", "express": "^4.17.1", "firebase-admin": "^9.5.0", "graphql": "^15.5.0", diff --git a/backend/typescript/services/implementations/__tests__/sendEmail.test.ts b/backend/typescript/services/implementations/__tests__/sendEmail.test.ts new file mode 100644 index 0000000..2a95ca3 --- /dev/null +++ b/backend/typescript/services/implementations/__tests__/sendEmail.test.ts @@ -0,0 +1,15 @@ +import EmailService from "../emailService"; +import IEmailService from "../../interfaces/emailService"; +import nodemailerConfig from "../../../nodemailer.config"; + +const emailService: IEmailService = new EmailService(nodemailerConfig); + +describe("sendEmail", () => { + it("sendEmail", async () => { + await emailService.sendEmail( + "hyunzeekim@uwblueprint.org", + "Test subject", + "Test body", + ); + }); +}); diff --git a/backend/typescript/yarn.lock b/backend/typescript/yarn.lock index f8d4985..37c3d97 100644 --- a/backend/typescript/yarn.lock +++ b/backend/typescript/yarn.lock @@ -2655,11 +2655,16 @@ dot-prop@^5.2.0: dependencies: is-obj "^2.0.0" -dotenv@*, dotenv@^8.2.0: +dotenv@*: version "8.2.0" resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.2.0.tgz#97e619259ada750eea3e4ea3e26bceea5424b16a" integrity sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw== +dotenv@^16.0.3: + version "16.0.3" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.0.3.tgz#115aec42bac5053db3c456db30cc243a5a836a07" + integrity sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ== + dottie@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/dottie/-/dottie-2.0.2.tgz#cc91c0726ce3a054ebf11c55fbc92a7f266dd154"