diff --git a/.github/workflows/quality-gate.yml b/.github/workflows/quality-gate.yml index cdf686e..40c3e1f 100644 --- a/.github/workflows/quality-gate.yml +++ b/.github/workflows/quality-gate.yml @@ -13,5 +13,8 @@ jobs: cache: 'yarn' - run: yarn install --frozen-lockfile + - name: Run type checking + run: yarn type-check + - name: Run unit tests run: yarn test diff --git a/index.d.ts b/index.d.ts index d414aaa..b832414 100644 --- a/index.d.ts +++ b/index.d.ts @@ -42,7 +42,7 @@ declare namespace init { * This function is called for every test setup and teardown to determine if the test should * skip console checks from this package or not. */ - skipTest?: ({ testName: string, testPath: string }) => boolean + skipTest?: (args: { testName: string; testPath: string }) => boolean } } diff --git a/package.json b/package.json index ea049de..30f1896 100644 --- a/package.json +++ b/package.json @@ -16,14 +16,16 @@ ], "scripts": { "npm:publish": "np", - "test": "jest tests/index.test.js" + "test": "jest tests/index.test.js", + "type-check": "tsc --noEmit index.d.ts" }, "dependencies": { "chalk": "^4.1.0" }, "devDependencies": { "jest": "^27.5.1", - "np": "^7.2.0" + "np": "^7.2.0", + "typescript": "^4.8.2" }, "files": [ "index.js", diff --git a/yarn.lock b/yarn.lock index 3f920ff..79fe732 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4046,6 +4046,11 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" +typescript@^4.8.2: + version "4.8.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.2.tgz#e3b33d5ccfb5914e4eeab6699cf208adee3fd790" + integrity sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw== + unique-string@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz"