diff --git a/package.json b/package.json index 7e2940b..47a7441 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "start:debug": "nest start --debug 0.0.0.0:7001 --watch --preserveWatchOutput", "start:prod": "node dist/main", "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", - "test": "jest --no-cache --colors --detectOpenHandles", + "test:all": "CI=true npm run test -- --coverage", + "test": "jest --passWithNoTests --no-cache --runInBand --detectOpenHandles --coverage --colors", "test:watch": "jest --watchAll", "test:cov": "jest --runInBand --coverage --colors", "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", @@ -56,6 +57,7 @@ "helmet": "6.0.0", "passport": "0.5.2", "passport-jwt": "4.0.0", + "jest-sonar-reporter": "^2.0.0", "passport-local": "1.0.0", "pg": "8.7.3", "reflect-metadata": "0.1.13", @@ -76,7 +78,7 @@ "@types/cors": "2.8.12", "@types/express": "4.17.13", "@types/express-actuator": "1.8.0", - "@types/jest": "27.0.2", + "@types/jest": "^29.5.6", "@types/node": "18.17.0", "@types/passport-jwt": "3.0.6", "@types/passport-local": "1.0.34", @@ -87,13 +89,16 @@ "eslint": "8.10.0", "eslint-config-prettier": "8.4.0", "eslint-plugin-prettier": "4.0.0", + "jest-sonar-reporter": "^2.0.0", "graphql": "16.6.0", - "jest": "27.5.1", + "jest": "^29.2.1", + "jest-sonar": "^0.2.16", + "jest-mock-extended": "^3.0.5", + "ts-jest": "^29.1.1", "prettier": "2.5.1", "sonarqube-scanner": "2.8.1", "source-map-support": "0.5.21", "supertest": "6.2.2", - "ts-jest": "27.1.3", "ts-loader": "9.2.7", "ts-node": "10.6.0", "tsconfig-paths": "3.12.0", @@ -115,9 +120,21 @@ "transform": { "^.+\\.(t|j)s$": "ts-jest" }, + "collectCoverage": true, "collectCoverageFrom": [ "**/*.(t|j)s" ], + "reporters": [ + "default", + [ + "jest-sonar", + { + "outputDirectory": "reports", + "outputName": "sonar-report.xml", + "sonarQubeVersion": "LATEST" + } + ] + ], "coverageDirectory": "../coverage/unit", "coveragePathIgnorePatterns": [ "src/migration",