Skip to content

Commit

Permalink
test: typechecking for tests (#145)
Browse files Browse the repository at this point in the history
Co-authored-by: Jeroen Claassens <support@favware.tech>
  • Loading branch information
imranbarbhuiya and favna authored Jul 3, 2022
1 parent 61cab3d commit 273cdc8
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/auto-deprecate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
auto-deprecate:
name: NPM Auto Deprecate
runs-on: ubuntu-latest
if: github.repository_owner == 'sapphiredev'
steps:
- name: Checkout Project
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/continuous-delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
Publish:
name: Publish Next to npm
runs-on: ubuntu-latest
if: github.repository_owner == 'sapphiredev'
steps:
- name: Checkout Project
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ jobs:
registry-url: https://registry.npmjs.org/
- name: Install Dependencies
run: yarn --immutable
- name: Build Code
run: yarn build
- name: Typecheck And Build Code
run: yarn typecheck && yarn build

Upload_Coverage_Report:
name: Upload coverage report to codecov
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/labelsync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
label_sync:
name: Automatic Label Synchronization
runs-on: ubuntu-latest
if: github.repository_owner == 'sapphiredev'
steps:
- name: Checkout Project
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
Expand Down
6 changes: 3 additions & 3 deletions tests/lib/configs.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { s, setGlobalValidationEnabled } from '../../src';
import { BaseValidator, s, setGlobalValidationEnabled } from '../../src';

describe('Validation enabled and disabled configurations', () => {
const stringPredicate = s.string.lengthGreaterThan(5);
Expand All @@ -11,7 +11,7 @@ describe('Validation enabled and disabled configurations', () => {
const setPredicate = s.set(s.number);
const tuplePredicate = s.tuple([s.string, s.number]);

const predicateAndValues = [
const predicateAndValues: [string, BaseValidator<unknown>, unknown][] = [
//
['string', stringPredicate, ''],
['array', arrayPredicate, []],
Expand All @@ -20,7 +20,7 @@ describe('Validation enabled and disabled configurations', () => {
['record', recordPredicate, { one: 'one' }],
['set', setPredicate, new Set(['1'])],
['tuple', tuplePredicate, [0, 'zero']]
] as const;
];

describe('Global configurations', () => {
beforeAll(() => {
Expand Down
7 changes: 4 additions & 3 deletions tsconfig.typecheck.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"rootDir": "./src",
"noEmit": true
"noEmit": true,
"lib": ["DOM", "ESNext"],
"types": ["vitest/globals"]
},
"include": ["src"]
"include": ["src", "tests"]
}

0 comments on commit 273cdc8

Please sign in to comment.