Skip to content

Commit aa699f9

Browse files
committed
Fix linting errors
1 parent 17f42a1 commit aa699f9

35 files changed

+36
-58
lines changed

src/api/v1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import basicAuth from '../middleware/basicAuth';
2929
import bearerAuth from '../middleware/bearerAuth';
3030
import refreshToken from '../middleware/refreshToken';
3131
import uploadImageProfile from '../middleware/uploadImageProfile';
32-
import uploadImagesMax from '../middleware/uploadImagesMax';
32+
// import uploadImagesMax from '../middleware/uploadImagesMax';
3333
import validRole from '../middleware/validateRole';
3434
import validTopic from '../middleware/validateTopic';
3535
import validateUserIdAdmin from '../middleware/validateUserIdAdmin';

src/middleware/allowAll.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { NextFunction, Request, Response } from 'express';
2-
import { AccessControlRow, requestAccess } from '../utils/access';
2+
import { requestAccess } from '../utils/access';
33

44
const access = async (req: Request, res: Response, next: NextFunction) => {
55
res.locals.accessRegex = requestAccess();

src/middleware/basicAuth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const auth = async (req: Request, res: Response, next: NextFunction) => {
3737
if (!authorization) throw new AppError(errDef[401].AuthorizationNotFound);
3838

3939
const [scheme, cred] = authorization.split(' ');
40-
if (scheme != 'Basic') throw new AppError(errDef[401].InvalidAuthScheme);
40+
if (scheme !== 'Basic') throw new AppError(errDef[401].InvalidAuthScheme);
4141
if (!cred) throw new AppError(errDef[401].UserCredentialNotFound);
4242

4343
const { username, password } = decodeCredential(cred);

src/middleware/bearerAuth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const auth = async (req: Request, res: Response, next: NextFunction) => {
1515
if (!authorization) throw new AppError(errDef[401].AuthorizationNotFound);
1616

1717
const [scheme, accessToken] = authorization.split(' ');
18-
if (scheme != 'Bearer') throw new AppError(errDef[401].InvalidAuthScheme);
18+
if (scheme !== 'Bearer') throw new AppError(errDef[401].InvalidAuthScheme);
1919
if (!accessToken) throw new AppError(errDef[401].AccessTokenNotFound);
2020

2121
// Get regex from access control

src/middleware/uploadImageProfile.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const uploader = async (req: Request, res: Response, next: NextFunction) => {
2525
// create a dir
2626
try {
2727
await fs.promises.access(fileDir);
28-
} catch (error) {
28+
} catch (_error: any) {
2929
await fs.promises.mkdir(fileDir, { recursive: true });
3030
}
3131

@@ -63,7 +63,7 @@ const uploader = async (req: Request, res: Response, next: NextFunction) => {
6363
}
6464
});
6565

66-
bb.on('field', (fieldname: string, value: string, info: FieldInfo) => {
66+
bb.on('field', (fieldname: string, value: string, _info: FieldInfo) => {
6767
req.body[fieldname] = value;
6868
});
6969

@@ -87,6 +87,7 @@ const uploader = async (req: Request, res: Response, next: NextFunction) => {
8787
});
8888

8989
bb.on('close', () => {
90+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
9091
resultError ? next(resultError) : next();
9192
});
9293

src/middleware/uploadImagesMax.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const uploader =
2828
// create a dir
2929
try {
3030
await fs.promises.access(fileDir);
31-
} catch (error) {
31+
} catch (_error: any) {
3232
await fs.promises.mkdir(fileDir, { recursive: true });
3333
}
3434

@@ -66,7 +66,7 @@ const uploader =
6666
}
6767
});
6868

69-
bb.on('field', (fieldname: string, value: string, info: FieldInfo) => {
69+
bb.on('field', (fieldname: string, value: string, _info: FieldInfo) => {
7070
req.body[fieldname] = value;
7171
});
7272

@@ -89,6 +89,7 @@ const uploader =
8989
});
9090

9191
bb.on('close', () => {
92+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
9293
resultError ? next(resultError) : next();
9394
});
9495

src/middleware/validateUserIdAdmin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { NextFunction, Request, Response } from 'express';
2-
import { JwtPayload } from 'jsonwebtoken';
2+
// import { JwtPayload } from 'jsonwebtoken';
33
import { AppError, errDef } from '../utils/errors';
44
import { IBearerAuthResLocals } from './bearerAuth';
55

src/middleware/validateUserIdUser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { NextFunction, Request, Response } from 'express';
2-
import { JwtPayload } from 'jsonwebtoken';
2+
// import { JwtPayload } from 'jsonwebtoken';
33
import { AppError, errDef } from '../utils/errors';
44
import { IBearerAuthResLocals } from './bearerAuth';
55

src/server.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ import config from './utils/config';
22
config();
33

44
import cors from 'cors';
5-
import express, { NextFunction, Request, Response } from 'express';
5+
import express from 'express';
66
import helmet from 'helmet';
77
import pinoHttp from 'pino-http';
88
import apiRouter from './api';
99
import errorHandler from './errorHandler';
1010
import { corsOption } from './utils/cors';
1111
import { logger, pinoExpOpt } from './utils/logger';
1212

13-
const { TRUST_PROXY = '', PORT = '3000' } = process.env;
13+
// const { TRUST_PROXY = '' } = process.env;
14+
const { PORT = '3000' } = process.env;
1415
const app = express();
1516

1617
// Tell Express if this app is behind a proxy

src/services/createRole/provider.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import { QueryResult } from 'pg';
21
import { IPermission } from '../../utils/access';
32
import db from '../../utils/db';
4-
import { UK_ERR_CODE } from '../../utils/errors';
53

64
export const SQL_INSERT_ROLE = `INSERT INTO user_role(name)
75
VALUES ($1::VARCHAR(50))

src/services/deletePushTopic/apiHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { NextFunction, Request, Response } from 'express';
22
import { AppError, errDef } from '../../utils/errors';
33
import provider from './provider';
4-
import { IResBody, IResLocals } from './types';
4+
import { IResLocals } from './types';
55

66
const handler = async (req: Request, res: Response, next: NextFunction) => {
77
try {

src/services/deletePushTopic/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//export interface IReqBody {}
2-
export interface IResBody {}
31
export interface IResLocals {
42
topicName: string;
53
}

src/services/readPushTopic/apiHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { NextFunction, Request, Response } from 'express';
22
import { AppError, errDef } from '../../utils/errors';
33
import provider from './provider';
4-
import { IResBody, IResLocals } from './types';
4+
import { IResLocals } from './types';
55

66
const handler = async (req: Request, res: Response, next: NextFunction) => {
77
try {

src/services/readPushTopic/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//export interface IReqBody {}
2-
export interface IResBody {}
31
export interface IResLocals {
42
topicName: string;
53
}

src/services/readResource/apiHandler.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { NextFunction, Request, Response } from 'express';
2-
import { AppError, errDef } from '../../utils/errors';
32
import provider from './provider';
43

54
const handler = async (req: Request, res: Response, next: NextFunction) => {

src/services/readResource/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//export interface IReqBody {}
2-
export interface IResBody {}
31
export interface IResLocals {
42
userId: number;
53
}

src/services/sendNoti/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ export interface IReqBody {
22
topic: any;
33
payload: any;
44
}
5-
export interface IResBody {}

src/utils/access.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const isValidPermit = (permit: any) => {
2121
export const convertToString = (row: AccessControlRow) => {
2222
if (!row.readable && !row.writable) return;
2323

24-
let access: string[] = [];
24+
const access: string[] = [];
2525
if (row.readable) access.push(`${row.name}:read`);
2626
if (row.writable) access.push(`${row.name}:write`);
2727
return access.join(' ');
@@ -39,7 +39,7 @@ export const requestAccess = (rows: AccessControlRow[] = []) => {
3939
throw new Error('duplicated resource name detected in access request'); // names should be unique
4040
});
4141

42-
let access: string[] = [];
42+
const access: string[] = [];
4343
rows.forEach((req) => {
4444
if (req.readable) access.push(`${req.name}:read`);
4545
if (req.writable) access.push(`${req.name}:write`);

src/utils/db.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ export const pool = new Pool({
99
connectionTimeoutMillis: parseInt(DB_CONN_TIMEOUT),
1010
});
1111

12-
pool.on('connect', (client) => {
12+
pool.on('connect', (_client) => {
1313
logger.info(`[DB Info] total connection count: ${pool.totalCount}`);
1414
});
1515

16-
pool.on('error', (err, client) => {
16+
pool.on('error', (err, _client) => {
1717
logger.error(`[DB Error] ${err.message}`);
1818
});
1919

src/utils/email.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const emailRegExp =
2-
/(?!.*\.{2})^([a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+(\.[a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)*|"((([ \t]*\r\n)?[ \t]+)?([\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*(([ \t]*\r\n)?[ \t]+)?")@(([a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.)+([a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])$/i;
2+
// eslint-disable-next-line no-control-regex
3+
/(?!.*\.{2})^([a-z\d!#$%&'*+\-/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+(\.[a-z\d!#$%&'*+\-/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)*|"((([ \t]*\r\n)?[ \t]+)?([\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*(([ \t]*\r\n)?[ \t]+)?")@(([a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.)+([a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])$/i;
34

45
export const isEmailValid = (email: string | undefined) => {
56
if (!email || email.length > 50) return false;

src/utils/logger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const logger = pino({
1515

1616
export const pinoExpOpt: Options = {
1717
logger,
18-
customReceivedMessage: (req, res) => `${req.method} ${req.url}`,
18+
customReceivedMessage: (req, _res) => `${req.method} ${req.url}`,
1919
customSuccessMessage: (req, res, resTime) =>
2020
`Responded with status [${res.statusCode}] in ${resTime}s`,
2121
};

src/utils/webpush.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import webpush, { PushSubscription, RequestOptions, WebPushError } from 'web-push';
1+
import webpush, { PushSubscription, RequestOptions } from 'web-push';
22
import db from './db';
33
import { logger } from './logger';
44

@@ -19,7 +19,7 @@ const SQL_DELETE = `DELETE FROM subscription WHERE id IN ($1::INT[])`;
1919
export async function* getSubsByTopicFromDB(topic: string) {
2020
const result =
2121
topic === ALL ? await db.query(SQL_GET_ALL) : await db.query(SQL_GET_BY_TOPIC, [topic]);
22-
for (let row of result.rows) yield row as SubscriptionRow;
22+
for (const row of result.rows) yield row as SubscriptionRow;
2323
}
2424

2525
export const sendNotiByTopic = async (
@@ -32,7 +32,7 @@ export const sendNotiByTopic = async (
3232
const errors = []; // This collects errors during sending process and rethrows at the end
3333

3434
// Send noti
35-
for await (let row of getSubsByTopicFromDB(topic)) {
35+
for await (const row of getSubsByTopicFromDB(topic)) {
3636
const { id, sub } = row;
3737
try {
3838
const subObj: PushSubscription = JSON.parse(sub);
@@ -74,7 +74,7 @@ export const isValidSub = (subscription: any) => {
7474
subscription.keys.auth.length &&
7575
subscription.keys.p256dh.length;
7676
return n !== 0;
77-
} catch (error) {
77+
} catch (_error: any) {
7878
return false;
7979
}
8080
};

test/integration/apiAuthAdmin.test.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { Express } from 'express';
22
import { Server } from 'http';
33
import { QueryResult } from 'pg';
44
import supertest from 'supertest';
5-
import { SQL_INSERT_PERMIT, SQL_INSERT_ROLE } from '../../src/services/createRole/provider';
65
import hash from '../../src/utils/hash';
76
import initTest from '../initTest';
87
import {
@@ -130,12 +129,6 @@ describe('Test /admin/auth', () => {
130129
LEFT JOIN resource as T3 ON T1.resource_id=T3.id
131130
WHERE T2.name=$1::VARCHAR(50);`;
132131

133-
const permissions = [
134-
{ res_name: 'userpool', readable: true, writable: false },
135-
{ res_name: 'topic', readable: true, writable: false },
136-
{ res_name: 'subscription', readable: true, writable: false },
137-
];
138-
139132
it('should read a role', async () => {
140133
const testRole = await createRandomRole(db);
141134
const accessToken = await getToken(app, testObj.admin);
@@ -275,7 +268,6 @@ describe('Test /admin/auth', () => {
275268
.send(data);
276269
expect(res.status).toBe(200);
277270
expect(res.body).toHaveProperty('role_id');
278-
const roleId = res.body.role_id;
279271

280272
const check = await db.query(sqlRoleByName, [testRole]);
281273
expect(check.rowCount).toBe(0);

test/integration/apiAuthUser.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ describe('Test /auth', () => {
333333
const accessToken = await getToken(app, testUser);
334334
const fstream = fs.createReadStream(getUploadFilePath.img());
335335

336-
const res = await supertest(app)
336+
await supertest(app)
337337
.put(endPoint)
338338
.auth(accessToken, { type: 'bearer' })
339339
.set('Accept', 'application/json')
@@ -355,7 +355,7 @@ describe('Test /auth', () => {
355355
it('should return 204 when a user have never uploaded a profile picture', async () => {
356356
const accessToken = await getToken(app, testObj.user);
357357

358-
const res = await supertest(app)
358+
await supertest(app)
359359
.get(endPoint)
360360
.auth(accessToken, { type: 'bearer' })
361361
.set('Accept', 'application/json')

test/integration/apiPush.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { apiPrefix, getRandomPort, getTester, getToken, testObj } from '../testU
99

1010
const createRandomTopic = async (db: any) => {
1111
const name = hash.createUUID();
12-
const result = await db.query(SQL_INSERT_TOPIC, [name]);
12+
await db.query(SQL_INSERT_TOPIC, [name]);
1313
return name;
1414
};
1515

test/testUtil.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const createRandomRole = async (db: any) => {
5656

5757
for (let i = 0; i < testObj.permissions.length; i++) {
5858
const { res_name, readable, writable } = testObj.permissions[i];
59-
const r = await client.query(SQL_INSERT_PERMIT, [roleId, res_name, readable, writable]);
59+
await client.query(SQL_INSERT_PERMIT, [roleId, res_name, readable, writable]);
6060
}
6161
});
6262

@@ -103,7 +103,6 @@ export const getTester = (app: Express, method: string, url: string) => {
103103
break;
104104
default:
105105
throw new Error('invalid method');
106-
break;
107106
}
108107

109108
return tester;

test/unit/middleware/allow.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe('Test /src/middleware/allow', () => {
4444

4545
it.each(controllers)(
4646
'$name should set the accessRegex in res.locals and call next',
47-
async ({ name, controller }) => {
47+
async ({ controller }) => {
4848
await controller(req, res, next);
4949

5050
expect(getRow).toBeCalled();

test/unit/middleware/basicAuth.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jest.mock('../../../src/utils/hash', () => ({
1010

1111
import { NextFunction, Request, Response } from 'express';
1212
import { QueryResult } from 'pg';
13-
import auth, { decodeCredential } from '../../../src/middleware/basicAuth';
13+
import auth from '../../../src/middleware/basicAuth';
1414
import db from '../../../src/utils/db';
1515
import { isEmailValid } from '../../../src/utils/email';
1616
import { AppError, errDef } from '../../../src/utils/errors';

test/unit/services/createRole/provider.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ jest.mock('../../../../src/utils/db', () => ({ transaction: jest.fn((f) => f(cli
66
import provider from '../../../../src/services/createRole/provider';
77
import { IPermission } from '../../../../src/utils/access';
88
import db from '../../../../src/utils/db';
9-
import { UK_ERR_CODE } from '../../../../src/utils/errors';
109

1110
// Tests
1211
describe('Test /src/services/createRole/provider', () => {

test/unit/services/createToken/provider.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ jest.mock('../../../../src/utils/jwt', () => ({ sign: jest.fn() }));
99
jest.mock('../../../../src/utils/access', () => ({ convertToString: jest.fn() }));
1010

1111
// Imports
12-
import { QueryResult } from 'pg';
1312
import provider from '../../../../src/services/createToken/provider';
14-
import { AccessControlRow, convertToString } from '../../../../src/utils/access';
13+
import { convertToString } from '../../../../src/utils/access';
1514
import db from '../../../../src/utils/db';
1615
import hash from '../../../../src/utils/hash';
1716
import jwt from '../../../../src/utils/jwt';
@@ -46,7 +45,6 @@ describe('Test /src/services/createToken/provider', () => {
4645
[{ user_id: userId, device }, email, 'refresh', '30d'],
4746
];
4847
const expectedResult = { access_token: token, refresh_token: token };
49-
const expectedClientQuery = jest.fn();
5048

5149
mockedDbQuery.mockResolvedValue(queryResult);
5250
mockedConvertToString.mockImplementation((row) => `${row.name}:read`);

test/unit/services/sendNoti/handler.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import db from '../../../../src/utils/db';
1111
import { AppError, errDef } from '../../../../src/utils/errors';
1212
import { isValidTopic } from '../../../../src/utils/webpush';
1313

14-
const mockedProvider = provider as jest.Mock;
1514
const mockedTopicValidator = isValidTopic as jest.Mock;
1615
const mockedQuery = db.query as jest.Mock;
1716

test/unit/services/updateRole/provider.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ jest.mock('../../../../src/utils/db', () => ({ transaction: jest.fn((f) => f(cli
55
// Imports
66
import provider from '../../../../src/services/updateRole/provider';
77
import { IPermission } from '../../../../src/utils/access';
8-
import db from '../../../../src/utils/db';
98
import { UK_ERR_CODE } from '../../../../src/utils/errors';
109
import { getDbErrorMock } from '../../../testUtil';
1110

test/unit/services/updateUserRole/handler.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ jest.mock('../../../../src/services/updateUserRole/provider', () => jest.fn());
55
import { NextFunction, Request, Response } from 'express';
66
import handler from '../../../../src/services/updateUserRole/apiHandler';
77
import provider from '../../../../src/services/updateUserRole/provider';
8-
import { AppError, errDef } from '../../../../src/utils/errors';
98

109
const mockedProvider = provider as jest.Mock;
1110

0 commit comments

Comments
 (0)