Skip to content

Commit 74f4850

Browse files
committed
Upgrade jest and fix typescript config
1 parent e806265 commit 74f4850

File tree

8 files changed

+522
-1688
lines changed

8 files changed

+522
-1688
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ $ yarn seed # to seed
111111

112112
## Setting up REST Client
113113

114-
Create a file or add `.vscode > settings.json` and switch an environment `Cmd/Ctrl + Shift + P` > `REST Client: Switch Environment`. Then, you can request APIs from `api.rest` file.
114+
Create a file or add following lines in `.vscode` > `settings.json` and switch an environment `Cmd/Ctrl + Shift + P` > `REST Client: Switch Environment`. Then, you can request APIs from `api.rest` file.
115115

116116
```
117117
{

babel.config.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module.exports = {
22
verbose: true,
3+
preset: 'ts-jest',
34
testEnvironment: 'node',
45
coverageDirectory: 'coverage',
56
testMatch: ['**/*/*.spec.ts'],

package.json

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@
3232
"lint:fix": "eslint --fix . --ext .ts,.json",
3333
"prettify": "prettier 'src/**/*.ts' --write"
3434
},
35-
"husky": {
36-
"hooks": {
37-
"pre-commit": "",
38-
"pre-push": "yarn build"
39-
}
40-
},
4135
"lint-staged": {
4236
"*.{ts,json}": [
4337
"eslint --fix . --ext .ts,.json"
@@ -74,35 +68,32 @@
7468
"winston-daily-rotate-file": "^4.5.5"
7569
},
7670
"devDependencies": {
77-
"@babel/core": "^7.14.8",
78-
"@babel/preset-env": "^7.14.8",
79-
"@babel/preset-typescript": "^7.14.5",
8071
"@faker-js/faker": "^7.3.0",
8172
"@types/bcrypt": "^5.0.0",
8273
"@types/bookshelf": "^1.2.2",
8374
"@types/cors": "^2.8.12",
8475
"@types/express": "^4.17.13",
85-
"@types/jest": "^26.0.24",
76+
"@types/jest": "^28.1.3",
8677
"@types/jsonwebtoken": "^8.5.4",
8778
"@types/morgan": "^1.9.3",
8879
"@types/node": "^16.4.0",
8980
"@types/nodemailer": "^6.4.4",
9081
"@types/supertest": "^2.0.11",
9182
"@typescript-eslint/eslint-plugin": "^5.30.0",
9283
"@typescript-eslint/parser": "^5.30.0",
93-
"babel-jest": "^27.0.6",
9484
"chalk": "^4.1.1",
9585
"concurrently": "^7.2.2",
9686
"eslint": "^8.18.0",
9787
"eslint-plugin-security": "^1.4.0",
9888
"husky": "^8.0.1",
99-
"jest": "^27.0.6",
89+
"jest": "^28.1.2",
10090
"lint-staged": "^11.0.1",
10191
"nodemon": "^2.0.12",
10292
"prettier": "^2.3.2",
10393
"rimraf": "^3.0.2",
10494
"supertest": "^6.1.4",
10595
"sync-dotenv": "^2.6.2",
96+
"ts-jest": "^28.0.5",
10697
"ts-node": "^10.8.1",
10798
"tslib": "^2.4.0",
10899
"typescript": "^4.7.4"

test/helper.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ const tables = [Table.USER_SESSIONS, Table.USERS];
1010

1111
export const TEST_EMAIL = faker.internet.email();
1212
export const TEST_PASSWORD = faker.internet.password();
13-
let userData;
13+
14+
let userData: UserDetail;
1415

1516
/**
1617
* Create user.

test/unit/bcrypt.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { faker } from '@faker-js/faker';
33
import { hash, compare } from '../../src/utils/bcrypt';
44

55
describe('Utils: compare()', () => {
6-
let hashedText;
6+
let hashedText: string;
77
const plainText = faker.internet.password();
88

99
beforeAll(async () => {

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"preserveSymlinks": true,
2727
"resolveJsonModule": true,
2828
"moduleResolution": "node",
29-
"types": ["node", "express"],
29+
"types": ["node", "express", "jest"],
3030
"allowSyntheticDefaultImports": true,
3131
"paths": {
3232
"*": ["node_modules/*", "src/types/*"]

yarn.lock

Lines changed: 513 additions & 1666 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)