chore: added global lint and test commands to backend package (#81)
* chore: added global lint and test commands to backend package * chore: removed lint command from root scope execution
This commit is contained in:
@@ -20,7 +20,8 @@
|
|||||||
"test:watch": "jest --watch",
|
"test:watch": "jest --watch",
|
||||||
"test:cov": "jest --coverage",
|
"test:cov": "jest --coverage",
|
||||||
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
"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": {
|
"dependencies": {
|
||||||
"@nestjs-modules/mailer": "^1.8.1",
|
"@nestjs-modules/mailer": "^1.8.1",
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import { MailerModule } from '../mailer/mailer.module';
|
|||||||
import { TeamModule } from '../team/team.module';
|
import { TeamModule } from '../team/team.module';
|
||||||
import { TeamInvitationModule } from '../team-invitation/team-invitation.module';
|
import { TeamInvitationModule } from '../team-invitation/team-invitation.module';
|
||||||
import { TeamEnvironmentsModule } from '../team-environments/team-environments.module';
|
import { TeamEnvironmentsModule } from '../team-environments/team-environments.module';
|
||||||
import {TeamCollectionModule} from "../team-collection/team-collection.module";
|
import { TeamCollectionModule } from '../team-collection/team-collection.module';
|
||||||
import {TeamRequestModule} from "../team-request/team-request.module";
|
import { TeamRequestModule } from '../team-request/team-request.module';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
|
|||||||
@@ -4,10 +4,7 @@ import * as O from 'fp-ts/Option';
|
|||||||
import * as TO from 'fp-ts/TaskOption';
|
import * as TO from 'fp-ts/TaskOption';
|
||||||
import * as E from 'fp-ts/Either';
|
import * as E from 'fp-ts/Either';
|
||||||
import { PrismaService } from 'src/prisma/prisma.service';
|
import { PrismaService } from 'src/prisma/prisma.service';
|
||||||
import {
|
import { SHORTCODE_INVALID_JSON, SHORTCODE_NOT_FOUND } from 'src/errors';
|
||||||
SHORTCODE_INVALID_JSON,
|
|
||||||
SHORTCODE_NOT_FOUND,
|
|
||||||
} from 'src/errors';
|
|
||||||
import { UserDataHandler } from 'src/user/user.data.handler';
|
import { UserDataHandler } from 'src/user/user.data.handler';
|
||||||
import { Shortcode } from './shortcode.model';
|
import { Shortcode } from './shortcode.model';
|
||||||
import { Shortcode as DBShortCode } from '@prisma/client';
|
import { Shortcode as DBShortCode } from '@prisma/client';
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ export class TeamInvitationResolver {
|
|||||||
description: 'Get the creator of the invite',
|
description: 'Get the creator of the invite',
|
||||||
})
|
})
|
||||||
async creator(@Parent() teamInvitation: TeamInvitation): Promise<User> {
|
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);
|
if (O.isNone(user)) throwErr(USER_NOT_FOUND);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -240,7 +240,9 @@ describe('deleteTeamRequest', () => {
|
|||||||
|
|
||||||
describe('createTeamRequest', () => {
|
describe('createTeamRequest', () => {
|
||||||
test('rejects for invalid collection id', async () => {
|
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(
|
const response = await teamRequestService.createTeamRequest(
|
||||||
'invalidcollid',
|
'invalidcollid',
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
import {
|
import { ObjectType, ID, Field, registerEnumType } from '@nestjs/graphql';
|
||||||
ObjectType,
|
|
||||||
ID,
|
|
||||||
Field,
|
|
||||||
registerEnumType,
|
|
||||||
} from '@nestjs/graphql';
|
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
export class User {
|
export class User {
|
||||||
|
|||||||
Reference in New Issue
Block a user