Skip to content

Commit

Permalink
test: test types
Browse files Browse the repository at this point in the history
  • Loading branch information
EdieLemoine committed Aug 1, 2023
1 parent 414d2bb commit cac4674
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 7 deletions.
12 changes: 11 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,24 @@
{
"files": [
"*.spec.*",
"**/__TESTS__/**/*"
"**/__tests__/**/*"
],
"rules": {
"@typescript-eslint/no-magic-numbers": "off",
"max-classes-per-file": "off",
"max-lines-per-function": "off",
"no-magic-numbers": "off"
}
},
{
"files": [
"**/__tests__/types/**/*"
],
"rules": {
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-unused-vars": "off",
"class-methods-use-this": "off"
}
}
]
}
4 changes: 4 additions & 0 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ runs:
steps:
- uses: myparcelnl/actions/yarn-install@v3

- name: 'Test types'
shell: bash
run: yarn test:types

- name: 'Run tests'
shell: bash
run: yarn test:run --coverage
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"build": "tsup src/index.ts -d lib --dts --format esm,cjs",
"prepare": "is-ci || husky install",
"test": "vitest",
"test:run": "vitest run"
"test:run": "vitest run",
"test:types": "tsc -p src/__tests__/types/tsconfig.test.json"
},
"lint-staged": {
"*.{js,ts}": "eslint --fix",
Expand Down
7 changes: 7 additions & 0 deletions src/__tests__/types/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"noEmit": true
},
"include": ["./**/*.ts"]
}
6 changes: 1 addition & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"declarationMap": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
Expand All @@ -12,8 +11,5 @@
"strict": true,
"target": "ESNext"
},
"exclude": [
"node_modules",
"lib"
]
"exclude": ["node_modules", "lib"]
}

0 comments on commit cac4674

Please sign in to comment.