Skip to content

Commit

Permalink
Paths refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Mvtthew committed Feb 5, 2022
1 parent abcf89d commit 757b1da
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
'!./src/config/**',
'!./src/tests/**',
],
moduleNameMapper: { "src/(.*)": "<rootDir>/src/$1" },
moduleNameMapper: { "@src/(.*)": "<rootDir>/src/$1" },
coverageReporters: [ 'text', 'text-summary', 'html', 'clover' ],
setupFilesAfterEnv: [ './src/tests/setupTests.ts' ],
testRegex: '.*\\.spec\\.ts$',
Expand Down
2 changes: 1 addition & 1 deletion src/config/mongodb.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import environmentConstants from 'src/constants/environment.constants';
import environmentConstants from '@src/constants/environment.constants';

const dockerMongoUri = 'mongodb://mongo/find-me-docker';

Expand Down
6 changes: 3 additions & 3 deletions src/modules/findme-users/findme-users.module.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Module } from '@nestjs/common';
import { MongooseModule } from '@nestjs/mongoose';
import { FindMeUsersController } from './findme-users.controller';
import { FindMeUser, FindMeUserSchema } from './schemas/findme-user.schema';
import { FindmeUsersService } from './findme-users.service';
import { FindMeUsersController } from '@src/modules/findme-users/findme-users.controller';
import { FindmeUsersService } from '@src/modules/findme-users/findme-users.service';
import { FindMeUser, FindMeUserSchema } from '@src/modules/findme-users/schemas/findme-user.schema';

@Module({
imports: [
Expand Down
2 changes: 1 addition & 1 deletion src/modules/findme-users/findme-users.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { FindMeUser, FindMeUserDocument } from '@src/modules/findme-users/schemas/findme-user.schema';
import { Model } from 'mongoose';
import { FindMeUser, FindMeUserDocument } from './schemas/findme-user.schema';

@Injectable()
export class FindmeUsersService {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Test, TestingModule } from '@nestjs/testing';
import { FindMeUsersController } from './findme-users.controller';
import { FindMeUsersController } from '@src/modules/findme-users/findme-users.controller';

describe('FindmeUsersController', () => {
let controller: FindMeUsersController;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { getModelToken } from '@nestjs/mongoose';
import { Test, TestingModule } from '@nestjs/testing';
import mongoDbModelMock from 'src/tests/mocks/mongoDbModel.mock';
import { FindmeUsersService } from './findme-users.service';
import { FindMeUser } from './schemas/findme-user.schema';
import { FindmeUsersService } from '@src/modules/findme-users/findme-users.service';
import { FindMeUser } from '@src/modules/findme-users/schemas/findme-user.schema';
import mongoDbModelMock from '@src/tests/mocks/mongoDbModel.mock';

describe('FindmeUsersService', () => {
let service: FindmeUsersService;
Expand Down
3 changes: 3 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
"noFallthroughCasesInSwitch": false,
"resolveJsonModule": true,
"esModuleInterop": true,
"paths": {
"@src/*": ["src/*"]
}
}
}

0 comments on commit 757b1da

Please sign in to comment.