mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
made preparations for coverage
This commit is contained in:
committed by
Aaro Koivukangas
parent
9a78530528
commit
e4d611ef8e
@@ -4,3 +4,4 @@ node_modules
|
|||||||
build
|
build
|
||||||
requests
|
requests
|
||||||
prisma/generated
|
prisma/generated
|
||||||
|
coverage
|
||||||
|
|||||||
+4
-4
@@ -54,15 +54,15 @@ ENV NODE_ENV=production
|
|||||||
|
|
||||||
CMD ["node", "src/index.js"]
|
CMD ["node", "src/index.js"]
|
||||||
|
|
||||||
|
|
||||||
FROM node:20-alpine3.16 AS api-tests
|
FROM node:20-alpine3.16 AS api-tests
|
||||||
|
|
||||||
USER node
|
USER node
|
||||||
|
COPY --chown=node --from=backend-build /usr/src/app /usr/src/app
|
||||||
|
|
||||||
WORKDIR /usr/src/app/backend
|
WORKDIR /usr/src/app/backend
|
||||||
|
|
||||||
COPY --chown=node backend/package.json .
|
|
||||||
COPY --chown=node backend/package-lock.json .
|
|
||||||
|
|
||||||
RUN npm ci
|
RUN npm ci
|
||||||
|
RUN npm run prisma
|
||||||
|
|
||||||
COPY --chown=node backend .
|
|
||||||
CMD ["npm", "run", "test"]
|
CMD ["npm", "run", "test"]
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
module.exports = {
|
||||||
|
testPathIgnorePatterns: [
|
||||||
|
"<rootDir>/build",
|
||||||
|
"<rootDir>/node_modules",
|
||||||
|
],
|
||||||
|
collectCoverageFrom: [
|
||||||
|
"./src/**",
|
||||||
|
"!./src/api-tests/**"
|
||||||
|
],
|
||||||
|
roots: [
|
||||||
|
"./src"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -6,18 +6,13 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "npx tsx watch --clear-screen=false src/index.ts",
|
"dev": "npx tsx watch --clear-screen=false src/index.ts",
|
||||||
"build": "tsc",
|
"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",
|
"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",
|
"start": "node build/index.js",
|
||||||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
"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",
|
"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"
|
"clean": "rm -rf node_modules && rm -rf prisma/generated && rm -rf build"
|
||||||
},
|
},
|
||||||
"jest": {
|
|
||||||
"testPathIgnorePatterns": ["build", "node_modules", "prisma"],
|
|
||||||
"testEnvironment": "node",
|
|
||||||
"roots": ["src"]
|
|
||||||
},
|
|
||||||
"author": "",
|
"author": "",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.18.5",
|
"@babel/core": "^7.18.5",
|
||||||
|
|||||||
@@ -39,8 +39,10 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
db-anon:
|
db-anon:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
backend:
|
env_file: .anon.env
|
||||||
condition: service_healthy
|
volumes:
|
||||||
|
- ./test_data:/usr/src/app/test_data
|
||||||
|
- ./backend/coverage:/usr/src/app/backend/coverage
|
||||||
environment:
|
environment:
|
||||||
API_TESTS_BASEURL: http://backend:4000
|
API_TESTS_BASEURL: http://backend:4000
|
||||||
build:
|
build:
|
||||||
|
|||||||
Generated
-1
@@ -9,7 +9,6 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/leaflet": "^1.9.12",
|
"@types/leaflet": "^1.9.12",
|
||||||
"@types/supertest": "^6.0.2",
|
|
||||||
"cypress": "^13.11.0",
|
"cypress": "^13.11.0",
|
||||||
"supertest": "^7.0.0"
|
"supertest": "^7.0.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,6 @@
|
|||||||
"author": "",
|
"author": "",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/leaflet": "^1.9.12",
|
"@types/leaflet": "^1.9.12",
|
||||||
"@types/supertest": "^6.0.2",
|
|
||||||
"cypress": "^13.11.0",
|
"cypress": "^13.11.0",
|
||||||
"supertest": "^7.0.0"
|
"supertest": "^7.0.0"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user