lint pretty --check

This commit is contained in:
sbriat 2023-03-30 10:28:20 +02:00
parent dd557c78f7
commit 6f571e05ca
7 changed files with 30 additions and 14 deletions

View File

@ -12,7 +12,7 @@ test:
stage: test
image: docker/compose:latest
variables:
DOCKER_TLS_CERTDIR: ""
DOCKER_TLS_CERTDIR: ''
services:
- docker:dind
script:
@ -33,7 +33,7 @@ build:
stage: build
image: docker:20.10.22
variables:
DOCKER_TLS_CERTDIR: ""
DOCKER_TLS_CERTDIR: ''
services:
- docker:dind
before_script:

6
.prettierignore Normal file
View File

@ -0,0 +1,6 @@
node_modules
*.log*
.env
dist
coverage
.prettierrc.json

View File

@ -158,15 +158,14 @@ For AuthZ, the app exposes the following [gRPC](https://grpc.io/) services :
}
```
## Messages
Various RabbitMQ messages are sent for logging purpose.
## Tests
## Tests / ESLint / Prettier
Tests are run outside the container for ease of use (switching between different environments inside containers using prisma is complicated and error prone).
The integration tests use a dedicated database (see *db-test* section of *docker-compose.yml*).
The integration tests use a dedicated database (see _db-test_ section of _docker-compose.yml_).
```bash
# run all tests (unit + integration)
@ -180,6 +179,12 @@ npm run test:integration
# coverage
npm run test:cov
# ESLint
npm run lint
# Prettier
npm run pretty
```
## License

View File

@ -25,5 +25,7 @@ RUN npm run build
# Run unit tests
RUN npm run test:unit:ci
# Start the server
CMD [ "node", "dist/main.js" ]
# ESLint / Prettier
RUN npm run lint:check
RUN npm run pretty:check

View File

@ -14,6 +14,9 @@
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"lint:check": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix-dry-run --ignore-path .gitignore",
"pretty:check": "./node_modules/.bin/prettier --check .",
"pretty": "./node_modules/.bin/prettier --write .",
"test": "npm run migrate:test && dotenv -e .env.test jest",
"test:unit": "jest --testPathPattern 'tests/unit/' --verbose",
"test:unit:ci": "jest --testPathPattern 'tests/unit/' --coverage",