Skip to content

Commit

Permalink
Merge pull request #84 from ttsukagoshi/jest
Browse files Browse the repository at this point in the history
Setup Jest tests
  • Loading branch information
ttsukagoshi authored Sep 19, 2023
2 parents fa36a87 + 6804a50 commit d2d1995
Show file tree
Hide file tree
Showing 19 changed files with 2,316 additions and 1,133 deletions.
12 changes: 12 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,20 @@ extends:
- 'plugin:prettier/recommended'
- 'plugin:@typescript-eslint/recommended-type-checked'
- 'plugin:@typescript-eslint/stylistic-type-checked'
overrides:
- {
files: ['test/**'],
plugins: ['jest'],
extends: ['plugin:jest/recommended'],
rules:
{
'@typescript-eslint/unbound-method': 'off',
'jest/unbound-method': 'error',
},
}
plugins:
- '@typescript-eslint'
- 'jest'
#########
# Rules #
#########
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/jest-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: 'jest coverage'
on:
pull_request:
branches:
- main
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ArtiomTr/jest-coverage-report-action@v2
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ is the equivalent of running
csv2gsheets convert --dry-run
```

#### Updating csv2gheets
#### Updating csv2gsheets

New releases will be posted on [the GitHub repository](https://github.com/ttsukagoshi/csv2gsheets). To update your installed version, run the following:

Expand Down
14 changes: 11 additions & 3 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,21 @@ export default {
collectCoverageFrom: [
'<rootDir>/src/**/*.ts',
'!<rootDir>/src/**/index.ts',
'!<rootDir>/src/**/auth.ts',
'!<rootDir>/src/**/constants.ts',
'!<rootDir>/src/**/package.ts',
'!<rootDir>/src/**/utils.ts',
'<rootDir>/postbuild/postbuild.mjs',
],
// The directory where Jest should output its coverage files
coverageDirectory: 'coverage',
// Indicates which provider should be used to instrument code for coverage
coverageProvider: 'v8',
coverageThreshold: {
global: {
branches: 100,
functions: 100,
lines: 100,
statements: 100,
},
},
extensionsToTreatAsEsm: ['.ts'],
moduleFileExtensions: ['ts', 'js', 'mjs', 'json'],
testEnvironment: 'node',
Expand All @@ -36,5 +41,8 @@ export default {
},
],
},
transformIgnorePatterns: [
'/node_modules/(?!chalk|escape-string-regexp|figures|inquirer|is-unicode-supported/)',
],
verbose: true,
};
Loading

0 comments on commit d2d1995

Please sign in to comment.