Skip to content
This repository has been archived by the owner on Feb 10, 2023. It is now read-only.

Commit

Permalink
Configure Jest using Typescript
Browse files Browse the repository at this point in the history
This brings auto-completion to Jest configuration.

See: jestjs/jest#10564
See: jestjs/jest#9636 (comment)
  • Loading branch information
johnmartel committed Oct 28, 2020
1 parent 943a0ba commit 6841248
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 17 deletions.
5 changes: 4 additions & 1 deletion jest.config.js → jest.config.ts
@@ -1,4 +1,6 @@
module.exports = {
import type { Config } from '@jest/types';

const config: Config.InitialOptions = {
collectCoverage: false,
collectCoverageFrom: ['src/**/*.ts', '!src/octokitTypes.ts', '!lib/**', '!node_modules/**'],
coverageDirectory: 'coverage',
Expand All @@ -17,3 +19,4 @@ module.exports = {
testEnvironment: 'node',
testPathIgnorePatterns: ['/fixtures/'],
};
export default config;
107 changes: 92 additions & 15 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -28,6 +28,7 @@
},
"homepage": "https://github.com/johnmartel/organization-membership-action#readme",
"devDependencies": {
"@jest/types": "26.6.1",
"@types/jest": "26.0.0",
"@typescript-eslint/eslint-plugin": "2.34.0",
"@typescript-eslint/parser": "2.34.0",
Expand All @@ -43,6 +44,7 @@
"prettier": "2.1.2",
"rimraf": "3.0.2",
"ts-jest": "26.4.1",
"ts-node": "9.0.0",
"typescript": "3.9.5"
},
"dependencies": {
Expand Down
5 changes: 4 additions & 1 deletion tsconfig.json
Expand Up @@ -24,5 +24,8 @@
"global.d.ts",
"src/**/*"
],
"compileOnSave": false
"compileOnSave": false,
"tsNode": {
"compiler": "typescript"
}
}

0 comments on commit 6841248

Please sign in to comment.