Skip to content

Commit

Permalink
updating configs for coverage report generation
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgs9988 committed Jul 16, 2024
1 parent c6c26f3 commit f289260
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"presets": [
["@babel/preset-env", { "targets": { "node": "current" } }],
"@babel/preset-typescript"
]
}

16 changes: 14 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,19 @@ module.exports = {
testEnvironment: 'node',
testMatch: ['**/__tests__/**/*.test.ts'],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1'
'^@/(.*)$': '<rootDir>/src/$1'
},
testTimeout: 20000,
};
collectCoverage: true,
coverageDirectory: 'coverage',
coverageReporters: ['text', 'lcov'],
coveragePathIgnorePatterns: [
"/node_modules/",
"/dist/",
"/src/server.js"
],
transform: {
"^.+\\.(ts|tsx)$": "ts-jest",
},
};

6 changes: 5 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "JSON RPC server for Shardeum",
"main": "src/server.js",
"scripts": {
"test": "NODE_ENV=test jest --detectOpenHandles --silent",
"test": "NODE_ENV=test jest --detectOpenHandles --silent --forceExit",
"start": "npm run compile && node dist/src/server.js",
"dev": "nodemon",
"compile": "tsc -p .",
Expand All @@ -13,7 +13,8 @@
"lint-windows": "eslint ./src/**/*.ts",
"update-docker-dev": "docker build -t registry.gitlab.com/shardeum/json-rpc-server:dev . --push",
"format-check": "prettier --check './src/**/*.ts'",
"local:test": "bash run_tests.sh"
"local:test": "bash run_tests.sh",
"coverage": "jest --coverage --detectOpenHandles --forceExit --silent"
},
"author": "thantsintoe",
"license": "ISC",
Expand Down

0 comments on commit f289260

Please sign in to comment.