Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tsd for testing types #164

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,8 @@ jobs:
- name: Install
run: pnpm install

- name: Types
run: pnpm types

- name: Test
run: pnpm test
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"./lib"
],
"dependencies": {
"papi": "^1.1.0",
"uuid": "^10.0.0"
"papi": "^1.1.0"
},
"devDependencies": {
"@types/node": "^22.7.6",
Expand All @@ -22,12 +21,14 @@
"prettier": "^3.3.3",
"should": "^13.2.1",
"sinon": "^19.0.2",
"temp": "^0.9.4"
"temp": "^0.9.4",
"tsd": "^0.31.2",
"uuid": "^10.0.0"
},
"scripts": {
"format": "prettier -w .",
"test": "jshint lib test && prettier -c . && nyc mocha -- --recursive --check-leaks && nyc check-coverage --statements 100 --functions 100 --branches 100 --lines 100",
"types": "dtslint test/types",
"types": "tsd",
"acceptance": "ACCEPTANCE=true nyc mocha -- test/acceptance --recursive --check-leaks --timeout 30000",
"acceptanceSetupMacOS": "sudo ifconfig lo0 alias 127.0.0.2 up && sudo ifconfig lo0 alias 127.0.0.3 up"
},
Expand Down
607 changes: 604 additions & 3 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions test-d/index.test-d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { expectType } from "tsd";

import Consul from "../lib";

const consul = new Consul();

expectType<Consul>(consul);
6 changes: 0 additions & 6 deletions test/types/.eslintrc

This file was deleted.

2 changes: 0 additions & 2 deletions test/types/index.d.ts

This file was deleted.

15 changes: 0 additions & 15 deletions test/types/tsconfig.json

This file was deleted.

6 changes: 0 additions & 6 deletions test/types/type-tests.ts

This file was deleted.