made preparations for coverage

This commit is contained in:
Aaro Koivukangas
2024-09-27 22:06:33 +03:00
committed by Aaro Koivukangas
parent 9a78530528
commit e4d611ef8e
7 changed files with 23 additions and 14 deletions
+1
View File
@@ -4,3 +4,4 @@ node_modules
build
requests
prisma/generated
coverage
+4 -4
View File
@@ -54,15 +54,15 @@ ENV NODE_ENV=production
CMD ["node", "src/index.js"]
FROM node:20-alpine3.16 AS api-tests
USER node
COPY --chown=node --from=backend-build /usr/src/app /usr/src/app
WORKDIR /usr/src/app/backend
COPY --chown=node backend/package.json .
COPY --chown=node backend/package-lock.json .
RUN npm ci
RUN npm run prisma
COPY --chown=node backend .
CMD ["npm", "run", "test"]
+13
View File
@@ -0,0 +1,13 @@
module.exports = {
testPathIgnorePatterns: [
"<rootDir>/build",
"<rootDir>/node_modules",
],
collectCoverageFrom: [
"./src/**",
"!./src/api-tests/**"
],
roots: [
"./src"
]
}
+1 -6
View File
@@ -6,18 +6,13 @@
"scripts": {
"dev": "npx tsx watch --clear-screen=false src/index.ts",
"build": "tsc",
"test": "jest src/api-tests --runInBand",
"test": "jest src/api-tests --runInBand --coverage --config jest-config.js --detectOpenHandles --forceExit",
"test:with_reset": "cd .. && npm run anon:down && npm run start:anon -- -d && sleep 60 && cd backend && npm run test; cd .. && npm run anon:down",
"start": "node build/index.js",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"prisma": "prisma generate --schema prisma/schema.prisma && prisma generate --schema prisma/schema_log.prisma",
"clean": "rm -rf node_modules && rm -rf prisma/generated && rm -rf build"
},
"jest": {
"testPathIgnorePatterns": ["build", "node_modules", "prisma"],
"testEnvironment": "node",
"roots": ["src"]
},
"author": "",
"devDependencies": {
"@babel/core": "^7.18.5",
+4 -2
View File
@@ -39,8 +39,10 @@ services:
depends_on:
db-anon:
condition: service_healthy
backend:
condition: service_healthy
env_file: .anon.env
volumes:
- ./test_data:/usr/src/app/test_data
- ./backend/coverage:/usr/src/app/backend/coverage
environment:
API_TESTS_BASEURL: http://backend:4000
build:
-1
View File
@@ -9,7 +9,6 @@
"version": "1.0.0",
"devDependencies": {
"@types/leaflet": "^1.9.12",
"@types/supertest": "^6.0.2",
"cypress": "^13.11.0",
"supertest": "^7.0.0"
}
-1
View File
@@ -29,7 +29,6 @@
"author": "",
"devDependencies": {
"@types/leaflet": "^1.9.12",
"@types/supertest": "^6.0.2",
"cypress": "^13.11.0",
"supertest": "^7.0.0"
}