Skip to content

Commit

Permalink
Fixed unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
print-Sathvik committed Mar 6, 2024
1 parent b3dff4c commit e8e713a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
cypress/screenshots
.env.*
.env
logs
20 changes: 20 additions & 0 deletions config/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"development": {
"username": "postgres",
"password": "postgres",
"database": "wd-todo-dev",
"host": "127.0.0.1",
"dialect": "postgres"
},
"test": {
"username": "postgres",
"password": "postgres",
"database": "wd-todo-test",
"host": "127.0.0.1",
"dialect": "postgres"
},
"production": {
"use_env_variable": "DATABASE_URL",
"dialect": "postgres"
}
}
5 changes: 3 additions & 2 deletions models/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ const Sequelize = require("sequelize");
const process = require("process");
const basename = path.basename(__filename);
const env = process.env.NODE_ENV || "development";
require('dotenv').config({ path: `.env.${process.env.NODE_ENV}` })
const config = require(__dirname + "/../config/config.js")[env];
// require('dotenv').config({ path: `.env.${process.env.NODE_ENV}` })
// const config = require(__dirname + "/../config/config.js")[env];
const config = require(__dirname + "/../config/config.json")[env];
const db = {};

let sequelize;
Expand Down

0 comments on commit e8e713a

Please sign in to comment.