Skip to content

Commit

Permalink
fix: update versions (#45)
Browse files Browse the repository at this point in the history
* fix: update versions

* fix: faker deprecations

---------

Co-authored-by: Yana Sidarava <[email protected]>
  • Loading branch information
yana617 and Yana Sidarava authored Aug 4, 2024
1 parent e3ac68e commit a1cd4e5
Show file tree
Hide file tree
Showing 8 changed files with 4,718 additions and 4,716 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v2
- name: setup node
Expand Down Expand Up @@ -56,4 +56,4 @@ jobs:
POSTGRES_PASSWORD: postgres
POSTGRES_TEST_HOST: localhost
POSTGRES_PORT: 5432
EVENTS_SERVICE_URL: fake.url
EVENTS_SERVICE_URL: https://fake.url
2 changes: 1 addition & 1 deletion dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.16.0
FROM node:18.20.4
LABEL maintainer="[email protected]"
ENV NODE_ENV=production PORT=1081

Expand Down
2 changes: 1 addition & 1 deletion dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.16.0
FROM node:18.20.4
LABEL maintainer="[email protected]"
ENV NODE_ENV=development PORT=1081

Expand Down
9,378 changes: 4,687 additions & 4,691 deletions package-lock.json

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,35 +37,35 @@
"author": "Yana Sidorova",
"license": "ISC",
"dependencies": {
"@babel/preset-env": "7.22.9",
"axios": "1.4.0",
"axios": "1.7.2",
"babel-register": "6.26.0",
"bcrypt": "5.1.0",
"cors": "2.8.5",
"dotenv": "16.0.3",
"express": "4.18.2",
"express-validator": "6.12.0",
"express": "4.19.2",
"express-validator": "6.15.0",
"js-yaml": "4.1.0",
"jsonwebtoken": "9.0.0",
"morgan": "1.10.0",
"pg": "8.11.3",
"pg-hstore": "2.3.4",
"sequelize": "6.32.0",
"sequelize": "6.37.3",
"sequelize-replace-enum-postgres": "1.6.0",
"swagger-ui-express": "4.3.0",
"uuid": "9.0.0"
},
"devDependencies": {
"@babel/eslint-parser": "7.21.8",
"@babel/plugin-transform-runtime": "7.22.4",
"@faker-js/faker": "^8.4.1",
"babel-jest": "29.5.0",
"eslint": "7.31.0",
"eslint-config-airbnb": "18.2.1",
"eslint-plugin-import": "2.23.4",
"jest": "27.0.0",
"nock": "13.1.4",
"nodemon": "2.0.22",
"@babel/eslint-parser": "7.25.1",
"@babel/plugin-transform-runtime": "7.24.7",
"@babel/preset-env": "7.25.3",
"@faker-js/faker": "8.4.1",
"babel-jest": "29.7.0",
"eslint": "8.57.0",
"eslint-config-airbnb": "19.0.4",
"eslint-plugin-import": "2.29.1",
"jest": "27.5.1",
"nock": "13.5.4",
"nodemon": "3.1.4",
"regenerator-runtime": "0.13.11",
"supertest": "6.1.3"
}
Expand Down
8 changes: 6 additions & 2 deletions src/database/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ let sequelize;
if (config.use_env_variable) {
sequelize = new Sequelize(process.env[config.use_env_variable], config);
} else {
sequelize = new Sequelize(config.database, config.username, config.password,
{ ...config, logging: false });
sequelize = new Sequelize(
config.database,
config.username,
config.password,
{ ...config, logging: false },
);
}

db.AdditionalFieldTemplate = AdditionalFieldTemplate(sequelize, DataTypes);
Expand Down
4 changes: 2 additions & 2 deletions src/tests/fixtures/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const generateUser = () => ({
id: v4(),
name: faker.internet.userName(),
surname: faker.internet.userName(),
phone: `37529${faker.datatype.number({ min: 1111111, max: 9999999 })}`,
phone: `37529${faker.number.int({ min: 1111111, max: 9999999 })}`,
email: faker.internet.email(),
birthday: new Date(),
password: faker.internet.password(),
Expand All @@ -21,7 +21,7 @@ const generateGuest = () => ({
id: v4(),
name: faker.internet.userName(),
surname: faker.internet.userName(),
phone: `37529${faker.datatype.number({ min: 1111111, max: 9999999 })}`,
phone: `37529${faker.number.int({ min: 1111111, max: 9999999 })}`,
});

const generateAft = () => ({
Expand Down
6 changes: 4 additions & 2 deletions src/tests/users.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,8 @@ describe('GET /users', () => {
expectedUsersCount: 0,
}];

test.each(testCases)('Should filter by roles correctly',
test.each(testCases)(
'Should filter by roles correctly',
async ({ tokenRole, rolesFilter, expectedUsersCount }) => {
const token = await createUserAndGetToken(generateUser(), tokenRole);

Expand All @@ -378,7 +379,8 @@ describe('GET /users', () => {

const { data: { users } } = response.body;
expect(users.length).toBe(expectedUsersCount);
});
},
);

test('pagination should work correctly', async () => {
const token = await createUserAndGetToken(generateUser(), 'ADMIN');
Expand Down

0 comments on commit a1cd4e5

Please sign in to comment.