Skip to content

Commit

Permalink
secret-scan: Add test coverage fix #521
Browse files Browse the repository at this point in the history
  • Loading branch information
Souvik9205 committed Nov 12, 2024
1 parent 1793d92 commit 432d355
Show file tree
Hide file tree
Showing 8 changed files with 175 additions and 89 deletions.
1 change: 1 addition & 0 deletions .github/workflows/validate-secret-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,4 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
flags: secret-scan
files: /coverage/packages/secret-scan/coverage-final.json
9 changes: 9 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,12 @@ flag_management:
target: 80%
- type: patch
target: 98%
- name: secret-scan
paths:
- packages/secret-scan/
carryforward: true
statuses:
- type: project
target: 80%
- type: patch
target: 98%
5 changes: 0 additions & 5 deletions packages/secret-scan/.mocharc.json

This file was deleted.

20 changes: 20 additions & 0 deletions packages/secret-scan/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type { Config } from 'jest'

const config: Config = {
displayName: 'secret scan',
testMatch: ['**/*.test.ts'],
transform: {
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }]
},
moduleFileExtensions: ['ts', 'js', 'html'],
preset: 'ts-jest',
testEnvironment: 'node',
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1'
},
coverageDirectory: '../../coverage/packages/secret-scan',
coverageReporters: ['json'],
collectCoverage: true
}

export default config
4 changes: 1 addition & 3 deletions packages/secret-scan/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"genKey": "tsx src/generateKey.ts",
"build": "tsup",
"test": "mocha",
"test": "jest",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"lint": "eslint \"{src,tests}/**/*.ts\" --fix"
},
Expand All @@ -17,12 +17,10 @@
".": "./dist/index.js"
},
"dependencies": {
"mocha": "^10.6.0",
"randexp": "^0.5.3",
"tsx": "^4.16.2"
},
"devDependencies": {
"@types/mocha": "^10.0.7",
"@types/node": "^20.14.10",
"eslint-config-standard-with-typescript": "^43.0.1",
"jest": "^29.5.0",
Expand Down
Loading

0 comments on commit 432d355

Please sign in to comment.