diff --git a/.gitignore b/.gitignore index b4103e0..59739a5 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ wwwroot/*.js node_modules typings dist -tests/coverage +coverage # IDEs diff --git a/package.json b/package.json index 01d61a1..5763601 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "scripts": { "build": "tsc --outDir dist/", "prepublishOnly": "rm -rf dist/ && npm run build", - "test": "jest --coverage --config ./tests/jest.config.js", + "test": "jest --config ./tests/jest.config.js", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix" }, diff --git a/tests/jest.config.js b/tests/jest.config.js index 5559dc0..e21a114 100644 --- a/tests/jest.config.js +++ b/tests/jest.config.js @@ -1,8 +1,18 @@ module.exports = { - collectCoverage: true, - coverageReporters: ['text', 'cobertura'], - testEnvironment: "node", preset: "ts-jest", - coveragePathIgnorePatterns: ["/node_modules/", "/tests/"], + rootDir: "../", + testEnvironment: "node", moduleFileExtensions: ["js", "d.ts", "ts", "json"], + collectCoverage: true, + coverageReporters: ["text", "cobertura", "lcov"], + collectCoverageFrom: [ + "**/**.{ts,tsx,js,jsx}", + "!**/**.d.ts", + "!**/**.eslintrc.js", + "!**/coverage/**", + "!**/dist/**", + "!**/example/**", + "!**/node_modules/**", + "!**/tests/**", + ], };