Skip to content

Commit

Permalink
chore: updated the jest configs (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnatG authored Feb 6, 2023
1 parent 1e2ed15 commit 33ba85a
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 27 deletions.
10 changes: 7 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,12 @@ module.exports = {
},
],
'no-console': ['error', { allow: ['info', 'error'] }],
'no-underscore-dangle': ['error', { allow: ['_id'] }],
'import/no-named-as-default': 'off',
'import/extensions': 'off',
'implicit-arrow-linebreak': 'off',
'import/newline-after-import': 'off',
'import/first': 'off',
'import/prefer-default-export': 'off',
'consistent-return': 'off',
'import/order': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
Expand All @@ -73,5 +70,12 @@ module.exports = {
'require-await': 'error',
'no-useless-constructor': 'off',
'class-methods-use-this': 'off',
'object-curly-newline': [
'error',
{
consistent: true,
},
],
},
ignorePatterns: ['**/node_modules/**', 'jest.config.js'],
};
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
### Description
# Description

[NestJS](https://github.com/nestjs/nest) framework TypeScript starter repository.

#### Features
## Features

- [x] MSSQL TypeORM setup
- [x] Dockerised application using NodeJS v19
Expand All @@ -15,6 +15,7 @@
- [x] Swagger based documentation
- [x] Config based on ENV variables
- [x] Automated API versioning `(/v1)`
- [x] Configuration for `Jest` tests
- [x] Automated releases based on conventional commits
- [x] Automated version bumps based on commit messages
- [ ] Configuration for Jest tests
Expand All @@ -29,10 +30,10 @@
- [ ] Add security headers
- [ ] Deployment pipelines

### Installation
## Installation

```bash
$ npm install
npm install
```

### Running the service (dev)
Expand Down Expand Up @@ -62,7 +63,7 @@ $ npm run api-test
To simplify the generation of new resources, you can use the boilerplate [CRUD](https://docs.nestjs.com/recipes/crud-generator)

```bash
$ nest g resource users
nest g resource users
```

### Writing Conventional Commits
Expand Down
10 changes: 10 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
collectCoverageFrom: ['**/*.ts'],
coverageDirectory: 'generated_reports/api-test',
testMatch: ['**/*.spec.ts'],
rootDir: 'src',
transform: { '^.+\\.(t|j)s$': 'ts-jest' },
moduleFileExtensions: ['ts', 'tsx', 'js', 'json', 'node'],
preset: 'ts-jest',
testEnvironment: 'node',
};
17 changes: 0 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,5 @@
"ts-node": "^10.9.1",
"tsconfig-paths": "4.1.2",
"typescript": "^4.9.5"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
}
2 changes: 1 addition & 1 deletion src/modules/healthcheck/healthcheck.module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { HealthcheckController } from './healthcheck.controller';
import { HealthcheckService } from './healthcheck.service';
import { TypeOrmModule } from '@nestjs/typeorm';
import { UkefId } from '../numbers/entities/ukef-id.entity';
import { MarketEntity } from '../markets/entities/market.entity';

Expand Down
2 changes: 1 addition & 1 deletion src/modules/numbers/numbers.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable, NotFoundException } from '@nestjs/common';
import { CreateUkefIdDto } from './dto/create-ukef-id.dto';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { CreateUkefIdDto } from './dto/create-ukef-id.dto';
import { UkefId } from './entities/ukef-id.entity';

@Injectable()
Expand Down

0 comments on commit 33ba85a

Please sign in to comment.