Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

chore: added global lint and test commands to backend package (#81)

Balu Babu4ce9e67460fb
diff --git a/packages/hoppscotch-backend/package.json b/packages/hoppscotch-backend/package.json
index fba9e1ad7..52c0c33ad 100644
--- a/packages/hoppscotch-backend/package.json
+++ b/packages/hoppscotch-backend/package.json
@@ -20,7 +20,8 @@
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
- "test:e2e": "jest --config ./test/jest-e2e.json"
+ "test:e2e": "jest --config ./test/jest-e2e.json",
+ "do-test": "pnpm run test"
},
"dependencies": {
"@nestjs-modules/mailer": "^1.8.1",
diff --git a/packages/hoppscotch-backend/src/admin/admin.module.ts b/packages/hoppscotch-backend/src/admin/admin.module.ts
index d7eecc64d..f81f54245 100644
--- a/packages/hoppscotch-backend/src/admin/admin.module.ts
+++ b/packages/hoppscotch-backend/src/admin/admin.module.ts
@@ -8,8 +8,8 @@ import { MailerModule } from '../mailer/mailer.module';
import { TeamModule } from '../team/team.module';
import { TeamInvitationModule } from '../team-invitation/team-invitation.module';
import { TeamEnvironmentsModule } from '../team-environments/team-environments.module';
-import {TeamCollectionModule} from "../team-collection/team-collection.module";
-import {TeamRequestModule} from "../team-request/team-request.module";
+import { TeamCollectionModule } from '../team-collection/team-collection.module';
+import { TeamRequestModule } from '../team-request/team-request.module';
@Module({
imports: [
diff --git a/packages/hoppscotch-backend/src/prisma/prisma.service.ts b/packages/hoppscotch-backend/src/prisma/prisma.service.ts
index be48954ef..8febf1b5b 100644
--- a/packages/hoppscotch-backend/src/prisma/prisma.service.ts
+++ b/packages/hoppscotch-backend/src/prisma/prisma.service.ts
@@ -16,4 +16,4 @@ export class PrismaService
async onModuleDestroy() {
await this.$disconnect();
}
-}
\ No newline at end of file
+}
diff --git a/packages/hoppscotch-backend/src/shortcode/shortcode.service.ts b/packages/hoppscotch-backend/src/shortcode/shortcode.service.ts
index acb92e9d5..d7d0c5d9c 100644
--- a/packages/hoppscotch-backend/src/shortcode/shortcode.service.ts
+++ b/packages/hoppscotch-backend/src/shortcode/shortcode.service.ts
@@ -4,10 +4,7 @@ import * as O from 'fp-ts/Option';
import * as TO from 'fp-ts/TaskOption';
import * as E from 'fp-ts/Either';
import { PrismaService } from 'src/prisma/prisma.service';
-import {
- SHORTCODE_INVALID_JSON,
- SHORTCODE_NOT_FOUND,
-} from 'src/errors';
+import { SHORTCODE_INVALID_JSON, SHORTCODE_NOT_FOUND } from 'src/errors';
import { UserDataHandler } from 'src/user/user.data.handler';
import { Shortcode } from './shortcode.model';
import { Shortcode as DBShortCode } from '@prisma/client';
diff --git a/packages/hoppscotch-backend/src/team-invitation/team-invitation.resolver.ts b/packages/hoppscotch-backend/src/team-invitation/team-invitation.resolver.ts
index 1e02a96d9..e11df0313 100644
--- a/packages/hoppscotch-backend/src/team-invitation/team-invitation.resolver.ts
+++ b/packages/hoppscotch-backend/src/team-invitation/team-invitation.resolver.ts
@@ -64,7 +64,7 @@ export class TeamInvitationResolver {
description: 'Get the creator of the invite',
})
async creator(@Parent() teamInvitation: TeamInvitation): Promise<User> {
- let user = await this.userService.findUserById(teamInvitation.creatorUid);
+ const user = await this.userService.findUserById(teamInvitation.creatorUid);
if (O.isNone(user)) throwErr(USER_NOT_FOUND);
return {
diff --git a/packages/hoppscotch-backend/src/team-request/team-request.service.spec.ts b/packages/hoppscotch-backend/src/team-request/team-request.service.spec.ts
index 31c826efc..4786742a6 100644
--- a/packages/hoppscotch-backend/src/team-request/team-request.service.spec.ts
+++ b/packages/hoppscotch-backend/src/team-request/team-request.service.spec.ts
@@ -240,7 +240,9 @@ describe('deleteTeamRequest', () => {
describe('createTeamRequest', () => {
test('rejects for invalid collection id', async () => {
- mockTeamCollectionService.getTeamOfCollection.mockResolvedValue(E.left(TEAM_INVALID_COLL_ID));
+ mockTeamCollectionService.getTeamOfCollection.mockResolvedValue(
+ E.left(TEAM_INVALID_COLL_ID),
+ );
const response = await teamRequestService.createTeamRequest(
'invalidcollid',
diff --git a/packages/hoppscotch-backend/src/user/user.model.ts b/packages/hoppscotch-backend/src/user/user.model.ts
index d5eeb1ed8..89d73f49b 100644
--- a/packages/hoppscotch-backend/src/user/user.model.ts
+++ b/packages/hoppscotch-backend/src/user/user.model.ts
@@ -1,9 +1,4 @@
-import {
- ObjectType,
- ID,
- Field,
- registerEnumType,
-} from '@nestjs/graphql';
+import { ObjectType, ID, Field, registerEnumType } from '@nestjs/graphql';
@ObjectType()
export class User {