Skip to content

Commit

Permalink
Merge pull request #7 from SuhravHussen/dev
Browse files Browse the repository at this point in the history
solved jest leaks in auth
  • Loading branch information
SuhravHussen committed Jul 24, 2023
2 parents 539518f + 349adfa commit c201e79
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"main": "index.js",
"scripts": {
"start": "ts-node-dev src/index.ts",
"test": "jest --watchAll --no-cache",
"test:ci": "jest --testTimeout=30000"
"test": "jest --watchAll --no-cache ",
"test:ci": "jest --detectOpenHandles"
},
"jest": {
"preset": "ts-jest",
Expand Down
1 change: 1 addition & 0 deletions auth/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import app from "./app";
//mongodb
const start = async () => {
try {
console.log("Starting up auth service...");
if (!process.env.JWT_SECRET || !process.env.MONGO_URI) {
throw new HttpException(500, " env must be defined");
}
Expand Down
3 changes: 1 addition & 2 deletions auth/src/test/setup.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { MongoMemoryServer } from "mongodb-memory-server";
import mongoose from "mongoose";
import app from "../app";

let mongo: any;
beforeAll(async () => {
process.env.JWT_SECRET = "test";
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";

const mongo = await MongoMemoryServer.create();
mongo = await MongoMemoryServer.create();
const mongoUri = mongo.getUri();

await mongoose.connect(mongoUri, {});
Expand Down

0 comments on commit c201e79

Please sign in to comment.