Skip to content

Commit

Permalink
馃殮 Move jest config into the package to fix ts issues
Browse files Browse the repository at this point in the history
There were issues related to the monorepo and ts-jest -
kulshekhar/ts-jest#1336 when we had jest config in root.
  • Loading branch information
Lukas Horak committed Oct 30, 2020
1 parent 4dfae3f commit d50e4ac
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
3 changes: 3 additions & 0 deletions jest.config.js
Expand Up @@ -5,6 +5,9 @@ module.exports = {
transform: {
"\\.ts$": "ts-jest",
},
globals: {
tsconfig: "<rootDir>/packages/lokse/test/tsconfig.json",
},
coverageReporters: ["lcov", "text-summary"],
collectCoverageFrom: ["packages/*/src/**/*.ts"],
coveragePathIgnorePatterns: ["/templates/"],
Expand Down
24 changes: 24 additions & 0 deletions packages/lokse/jest.config.js
@@ -0,0 +1,24 @@
module.exports = {
testEnvironment: "node",
moduleFileExtensions: ["ts", "js", "json"],
testMatch: ["<rootDir>/test/**/*.test.ts"],
transform: {
"\\.ts$": "ts-jest",
},
globals: {
"ts-jest": {
tsconfig: "<rootDir>/test/tsconfig.json",
},
},
coverageReporters: ["lcov", "text-summary"],
collectCoverageFrom: ["src/**/*.ts"],
coveragePathIgnorePatterns: ["/templates/"],
coverageThreshold: {
global: {
branches: 100,
functions: 100,
lines: 100,
statements: 100,
},
},
};
2 changes: 1 addition & 1 deletion packages/lokse/package.json
Expand Up @@ -65,7 +65,7 @@
"posttest": "yarn lint",
"prepack": "rm -rf lib && yarn build && oclif-dev manifest && oclif-dev readme",
"prettier": "prettier --write --config ../../.prettierrc \"(src|test)/**/*.ts\"",
"test": "jest --config ../../jest.config.js",
"test": "jest",
"version": "yarn readme && yarn changelog && code --wait CHANGELOG.md && git add README.md CHANGELOG.md",
"readme": "oclif-dev readme",
"changelog": "gitmoji-changelog",
Expand Down

0 comments on commit d50e4ac

Please sign in to comment.