Skip to content

Commit

Permalink
chore: add tsd-lite as jest tests
Browse files Browse the repository at this point in the history
Adds type testing as jest tests

closes #731
  • Loading branch information
hasezoey committed Jun 30, 2022
1 parent 5771195 commit e01595c
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 10 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/tests.yml
Expand Up @@ -42,13 +42,29 @@ jobs:
- name: Send codecov.io stats
if: matrix.node-version == '14.x'
uses: codecov/codecov-action@v3
test-types:
permissions:
contents: read # for actions/checkout to fetch code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 12
uses: actions/setup-node@v3
with:
node-version: 12.x
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Test Types
run: yarn run test:types --colors
env:
CI: true
publish:
permissions:
contents: write # for actions/checkout to fetch code and for semantic-release to push commits, release releases and tags
issues: write # for semantic-release to comment on and close issues
pull-requests: write # for semantic-release to comment on and close pull requests
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta' || startsWith(github.ref, 'refs/heads/old')
needs: [tests]
needs: [tests, test-types]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
13 changes: 13 additions & 0 deletions jest.config.tsd.json
@@ -0,0 +1,13 @@
{
"displayName": {
"color": "blue",
"name": "types"
},
"runner": "jest-runner-tsd",
"testRegex": ".test-d.ts$",
"testPathIgnorePatterns": [
"/node_modules/",
"/lib/"
],
"testTimeout": 10000
}
3 changes: 3 additions & 0 deletions package.json
Expand Up @@ -19,6 +19,7 @@
"test:watch": "jest --watchAll",
"test:coverage": "jest --collectCoverage",
"test:watchCoverage": "jest --collectCoverage --watchAll",
"test:types": "jest -c jest.config.tsd.json",
"watch": "tsc -w -p tsconfig.json",
"clean": "rimraf lib .tsbuildinfo coverage doc build",
"version:patch": "yarn version patch -m 'release: %s'",
Expand Down Expand Up @@ -53,6 +54,7 @@
"@types/lodash": "^4.14.182",
"@types/node": "~12.20.55",
"@types/semver": "^7.3.10",
"@tsd/typescript": "~4.4.4",
"@typescript-eslint/eslint-plugin": "^5.30.0",
"@typescript-eslint/parser": "^5.30.0",
"class-transformer": "0.5.1",
Expand All @@ -62,6 +64,7 @@
"eslint-plugin-prettier": "^4.1.0",
"husky": "^7.0.4",
"jest": "^28.1.1",
"jest-runner-tsd": "^3.1.0",
"lint-staged": "^11.2.6",
"mongodb-memory-server": "^8.7.1",
"mongoose": "~6.3.5",
Expand Down
68 changes: 59 additions & 9 deletions yarn.lock
Expand Up @@ -17,6 +17,13 @@
dependencies:
"@babel/highlight" "^7.16.7"

"@babel/code-frame@^7.15.8":
version "7.18.6"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a"
integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==
dependencies:
"@babel/highlight" "^7.18.6"

"@babel/compat-data@^7.17.10":
version "7.17.10"
resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.17.10.tgz#711dc726a492dfc8be8220028b1b92482362baab"
Expand Down Expand Up @@ -127,6 +134,11 @@
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz#e8c602438c4a8195751243da9031d1607d247cad"
integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==

"@babel/helper-validator-identifier@^7.18.6":
version "7.18.6"
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz#9c97e30d31b2b8c72a1d08984f2ca9b574d7a076"
integrity sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g==

"@babel/helper-validator-option@^7.16.7":
version "7.16.7"
resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz#b203ce62ce5fe153899b617c08957de860de4d23"
Expand All @@ -150,6 +162,15 @@
chalk "^2.0.0"
js-tokens "^4.0.0"

"@babel/highlight@^7.18.6":
version "7.18.6"
resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf"
integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==
dependencies:
"@babel/helper-validator-identifier" "^7.18.6"
chalk "^2.0.0"
js-tokens "^4.0.0"

"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.18.0":
version "7.18.4"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.4.tgz#6774231779dd700e0af29f6ad8d479582d7ce5ef"
Expand Down Expand Up @@ -1192,6 +1213,11 @@
resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.2.tgz#423c77877d0569db20e1fc80885ac4118314010e"
integrity sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==

"@tsd/typescript@~4.4.4":
version "4.4.4"
resolved "https://registry.yarnpkg.com/@tsd/typescript/-/typescript-4.4.4.tgz#c16c9327eb25e9b221be8e555d0d70a03006ef00"
integrity sha512-XNaotnbhU6sKSXYg9rVz4L9i9g+j+x1IIgMPztK8KumtMEsrLXcqPBKp/qzmUKwAZEqgHs4+TTz90dUu5/aIqQ==

"@types/babel__core@^7.1.14":
version "7.1.19"
resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.19.tgz#7b497495b7d1b4812bdb9d02804d0576f43ee460"
Expand Down Expand Up @@ -2232,6 +2258,15 @@ cosmiconfig@^7, cosmiconfig@^7.0.0, cosmiconfig@^7.0.1:
path-type "^4.0.0"
yaml "^1.10.0"

create-jest-runner@^0.11.1:
version "0.11.1"
resolved "https://registry.yarnpkg.com/create-jest-runner/-/create-jest-runner-0.11.1.tgz#ffaf2fccc60b08b762233637a4c4838bdc8eaf17"
integrity sha512-fmR1TpRhKIjmU1iXGRbpT2FXZkSlv58n+Cl2FvK5EIhy9kgM/bf/S7w1Nr3hg/jpHLaC0XLklmbZgt67iIV59A==
dependencies:
chalk "^4.1.0"
jest-worker "^28.0.2"
throat "^6.0.1"

create-require@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333"
Expand Down Expand Up @@ -3689,6 +3724,16 @@ jest-resolve@^28.1.1:
resolve.exports "^1.1.0"
slash "^3.0.0"

jest-runner-tsd@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/jest-runner-tsd/-/jest-runner-tsd-3.1.0.tgz#77789b323aa695c5aaf65303258e3c39ed5c35fa"
integrity sha512-cu8QRX6cUYKnrIFTOOfm5tixPwPwSyaMSXv3rpJzzWoa6eS3e9aFFtnY/lnSZZH9yROGrtl9B6+1snrLrrtKOw==
dependencies:
"@babel/code-frame" "^7.15.8"
chalk "^4.1.2"
create-jest-runner "^0.11.1"
tsd-lite "^0.5.4"

jest-runner@^28.1.1:
version "28.1.1"
resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-28.1.1.tgz#9ecdb3f27a00059986797aa6b012ba8306aa436c"
Expand Down Expand Up @@ -3823,7 +3868,7 @@ jest-watcher@^28.1.1:
jest-util "^28.1.1"
string-length "^4.0.1"

jest-worker@^28.1.1:
jest-worker@^28.0.2, jest-worker@^28.1.1:
version "28.1.1"
resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-28.1.1.tgz#3480c73247171dfd01eda77200f0063ab6a3bf28"
integrity sha512-Au7slXB08C6h+xbJPp7VIb6U0XX5Kc9uel/WFc6/rcTzGiaVCBRngBExSYuXSLFPULPSYU3cJ3ybS988lNFQhQ==
Expand Down Expand Up @@ -5800,7 +5845,7 @@ string-length@^4.0.1:
string-width@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=
integrity sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==
dependencies:
code-point-at "^1.0.0"
is-fullwidth-code-point "^1.0.0"
Expand Down Expand Up @@ -5854,14 +5899,14 @@ stringify-package@^1.0.1:
strip-ansi@^3.0.0, strip-ansi@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=
integrity sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==
dependencies:
ansi-regex "^2.0.0"

strip-ansi@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f"
integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8=
integrity sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==
dependencies:
ansi-regex "^3.0.0"

Expand Down Expand Up @@ -6002,7 +6047,7 @@ text-extensions@^1.0.0:
text-table@^0.2.0, text-table@~0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=
integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==

throat@^6.0.1:
version "6.0.1"
Expand Down Expand Up @@ -6131,6 +6176,11 @@ ts-node@^10.8.0:
v8-compile-cache-lib "^3.0.1"
yn "3.1.1"

tsd-lite@^0.5.4:
version "0.5.4"
resolved "https://registry.yarnpkg.com/tsd-lite/-/tsd-lite-0.5.4.tgz#ba139a7d398bd23ed728125365311e98b76d55e5"
integrity sha512-65GRufKZqu5/jJEzFj3K8TmX5sLrtM6FP5156ORZX1yfAXzucEtL4+hVQxvG8aqkhIu8O3Q/X53/8WNuiJPlkA==

tslib@^1.8.1:
version "1.14.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
Expand All @@ -6151,14 +6201,14 @@ tsutils@^3.21.0:
tunnel-agent@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=
integrity sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==
dependencies:
safe-buffer "^5.0.1"

tweetnacl@^0.14.3, tweetnacl@~0.14.0:
version "0.14.5"
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=
integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==

type-check@^0.4.0, type-check@~0.4.0:
version "0.4.0"
Expand Down Expand Up @@ -6312,14 +6362,14 @@ validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.4:
validate-npm-package-name@^3.0.0, validate-npm-package-name@~3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz#5fa912d81eb7d0c74afc140de7317f0ca7df437e"
integrity sha1-X6kS2B630MdK/BQN5zF/DKffQ34=
integrity sha512-M6w37eVCMMouJ9V/sdPGnC5H4uDr73/+xdq0FBLO3TFFX1+7wiUY6Es328NN+y43tmY+doUdN9g9J21vqB7iLw==
dependencies:
builtins "^1.0.3"

verror@1.10.0:
version "1.10.0"
resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400"
integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=
integrity sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==
dependencies:
assert-plus "^1.0.0"
core-util-is "1.0.2"
Expand Down

0 comments on commit e01595c

Please sign in to comment.