-
Notifications
You must be signed in to change notification settings - Fork 449
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #183 from mate-academy/add-test
test run
- Loading branch information
Showing
12 changed files
with
4,429 additions
and
10,457 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use strict'; | ||
|
||
const createServer = () => { | ||
// your code goes here | ||
}; | ||
|
||
module.exports = { | ||
createServer, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
'use strict'; | ||
|
||
const { Sequelize } = require('sequelize'); | ||
const utils = require('util'); | ||
|
||
// Needed for testing purposes, do not remove | ||
require('dotenv').config(); | ||
global.TextEncoder = utils.TextEncoder; | ||
|
||
const { | ||
POSTGRES_HOST, | ||
POSTGRES_PORT, | ||
POSTGRES_USER, | ||
POSTGRES_PASSWORD, | ||
POSTGRES_DB, | ||
} = process.env; | ||
|
||
/* | ||
All credentials setted to default values (exsept password - it is exapmle) | ||
replace if needed with your own | ||
*/ | ||
|
||
const sequelize = new Sequelize({ | ||
database: POSTGRES_DB || 'postgres', | ||
username: POSTGRES_USER || 'postgres', | ||
host: POSTGRES_HOST || 'localhost', | ||
dialect: 'postgres', | ||
port: POSTGRES_PORT || 5432, | ||
password: POSTGRES_PASSWORD || '123', | ||
}); | ||
|
||
module.exports = { | ||
sequelize, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
/* eslint-disable no-console */ | ||
|
||
'use strict'; | ||
|
||
const { createServer } = require('./createServer'); | ||
|
||
createServer() | ||
.listen(5700, () => { | ||
console.log('Server is running on localhost:5700'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use strict'; | ||
|
||
const { sequelize } = require('../db.js'); | ||
|
||
const Expense = sequelize.define( | ||
// your code goes here | ||
); | ||
|
||
module.exports = { | ||
Expense, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use strict'; | ||
|
||
const { sequelize } = require('../db.js'); | ||
|
||
const User = sequelize.define( | ||
// your code goes here | ||
); | ||
|
||
module.exports = { | ||
User, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use strict'; | ||
|
||
const { User } = require('./User.model'); | ||
const { Expense } = require('./Expense.model'); | ||
|
||
module.exports = { | ||
models: { | ||
User, | ||
Expense, | ||
}, | ||
}; |
Oops, something went wrong.