test
This commit is contained in:
parent
341889b6f7
commit
26b23a3ecc
@ -1,7 +1,7 @@
|
||||
|
||||
|
||||
NODE_ENV="development"
|
||||
MONGO_URL=""
|
||||
MONGO_URL="mongodb://localhost:27017/BudgetBuddy"
|
||||
PORT="2011"
|
||||
|
||||
TZ="Europe/Paris"
|
||||
|
@ -13,7 +13,7 @@
|
||||
"format": "prettier --write '**/*.{js,jsx,ts}'",
|
||||
"lint": "eslint . && yarn check-types",
|
||||
"setup": "yarn install",
|
||||
"start:development": "nodemon",
|
||||
"start": "nodemon",
|
||||
"start:production": "node dist/index.js",
|
||||
"test": "cross-env NODE_ENV=test jest",
|
||||
"test:cov": "cross-env NODE_ENV=test jest --coverage"
|
||||
|
@ -15,6 +15,7 @@ import { Express } from '@types'
|
||||
import cookieParser from 'cookie-parser'
|
||||
import cors from 'cors'
|
||||
import dotenv from 'dotenv'
|
||||
import * as process from "process";
|
||||
|
||||
dotenv.config()
|
||||
|
||||
|
@ -106,7 +106,7 @@ export const createUser = async (
|
||||
} catch (error) {
|
||||
return {
|
||||
status: HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
error: 'Internal server error',
|
||||
error: `Internal server error`,
|
||||
}
|
||||
}
|
||||
|
||||
@ -229,7 +229,7 @@ export const updateUser = async (
|
||||
} catch (error) {
|
||||
return {
|
||||
status: HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
error: 'Internal server error',
|
||||
error: 'Internal server error testing',
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import mongoose from 'mongoose'
|
||||
|
||||
import { MONGO_URL } from "../../../env";
|
||||
export const databaseConnection = async () => {
|
||||
const mongoUrl: string = decodeURIComponent(process.env.MONGO_URL || '')
|
||||
const mongoUrl: string = decodeURIComponent(process.env.MONGO_URL || MONGO_URL || '')
|
||||
|
||||
if (mongoUrl === '') {
|
||||
throw new Error('MONGO_URL has not been set')
|
||||
|
@ -8,7 +8,6 @@ const router = express.Router()
|
||||
|
||||
router.get('/', authenticated, async (req: AuthenticatedRequest, res: Response) => {
|
||||
const response = await getUsers(<IGetUserInput>req.query, <IUser>req.user)
|
||||
|
||||
return res.status(response.status).send(response.data || response.error)
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user