diff --git a/api/package.json b/api/package.json index 195e7312..4867ebee 100644 --- a/api/package.json +++ b/api/package.json @@ -51,22 +51,5 @@ "tsconfig-paths": "^4.2.0", "typescript": "^5.1.3", "ts-node": "^10.9.2" - }, - "jest": { - "moduleFileExtensions": [ - "js", - "json", - "ts" - ], - "rootDir": "src", - "testRegex": ".*\\.spec\\.ts$", - "transform": { - "^.+\\.(t|j)s$": "ts-jest" - }, - "collectCoverageFrom": [ - "**/*.(t|j)s" - ], - "coverageDirectory": "../coverage", - "testEnvironment": "node" } } diff --git a/api/src/app.controller.ts b/api/src/app.controller.ts index cce879ee..fad51c93 100644 --- a/api/src/app.controller.ts +++ b/api/src/app.controller.ts @@ -1,5 +1,5 @@ import { Controller, Get } from '@nestjs/common'; -import { AppService } from './app.service'; +import { AppService } from '@api/app.service'; @Controller() export class AppController { diff --git a/api/src/app.module.ts b/api/src/app.module.ts index 891a64b2..5ab18be6 100644 --- a/api/src/app.module.ts +++ b/api/src/app.module.ts @@ -1,6 +1,6 @@ import { Module } from '@nestjs/common'; import { AppController } from './app.controller'; -import { AppService } from './app.service'; +import { AppService } from '@api/app.service'; import { UsersModule } from '@api/modules/users/users.module'; @Module({ diff --git a/api/src/modules/users/users.controller.ts b/api/src/modules/users/users.controller.ts index 0e144234..de4450aa 100644 --- a/api/src/modules/users/users.controller.ts +++ b/api/src/modules/users/users.controller.ts @@ -1,10 +1,8 @@ import { Controller, Get } from '@nestjs/common'; -import { userContract } from '@shared/contracts/user.contract'; -const contract = userContract; @Controller() export class UsersController { - @Get(contract.createUser.path) + @Get('users') createUser() { return 'This action adds a new user'; } diff --git a/api/test/jest-e2e.json b/api/test/jest-e2e.json index c3666e83..84771cdc 100644 --- a/api/test/jest-e2e.json +++ b/api/test/jest-e2e.json @@ -9,5 +9,11 @@ "testRegex": ".spec.ts$", "transform": { "^.+\\.(t|j)s$": "ts-jest" + }, + + "moduleNameMapper": { + "^@api/(.*)$": "/src/$1", + "^@client/(.*)$": "/../client/src/$1", + "^@shared/(.*)$": "/../shared/$1" } } diff --git a/api/test/users/users.service.spec.ts b/api/test/users/users.service.spec.ts index 5c0b1b66..c7711cbc 100644 --- a/api/test/users/users.service.spec.ts +++ b/api/test/users/users.service.spec.ts @@ -1,5 +1,5 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { UsersService } from '../../src/modules/users/users.service'; +import { UsersService } from '@api/modules/users/users.service'; describe('UsersService', () => { let service: UsersService; diff --git a/client/tsconfig.json b/client/tsconfig.json index 25afd42f..82cc363a 100644 --- a/client/tsconfig.json +++ b/client/tsconfig.json @@ -18,6 +18,7 @@ "isolatedModules": true, "jsx": "preserve", "incremental": true, + "strictPropertyInitialization": false, "plugins": [ { "name": "next"