From 09e3686c7849f3602be91bd4b16e732540e060df Mon Sep 17 00:00:00 2001 From: Tony133 Date: Mon, 4 May 2026 10:28:51 +0200 Subject: [PATCH 1/2] refactor(types): migrate from tsd to tstyche --- package.json | 6 +++--- types/index.test-d.ts | 11 ----------- types/index.tst.ts | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+), 14 deletions(-) delete mode 100644 types/index.test-d.ts create mode 100644 types/index.tst.ts diff --git a/package.json b/package.json index 69a96b1..abf42c8 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "c8": "^11.0.0", "eslint": "^9.17.0", "neostandard": "^0.13.0", - "tsd": "^0.33.0" + "tstyche": "^7.0.0" }, "types": "types/index.d.ts", "files": [ @@ -69,6 +69,6 @@ "lint:fix": "eslint --fix", "test": "npm run test:unit && npm run test:typescript", "test:unit": "c8 --100 node --test", - "test:typescript": "tsd" + "test:typescript": "tstyche" } -} +} \ No newline at end of file diff --git a/types/index.test-d.ts b/types/index.test-d.ts deleted file mode 100644 index 81c35cd..0000000 --- a/types/index.test-d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { IncomingMessage } from 'node:http' -import { expectError, expectType } from 'tsd' -import forwardedESM, { forwarded } from '..' -import * as forwardedVarImport from '..' - -expectType(forwardedESM({} as IncomingMessage)) -expectType(forwarded({} as IncomingMessage)) -expectType(forwardedVarImport.default({} as IncomingMessage)) -expectType(forwardedVarImport.forwarded({} as IncomingMessage)) -expectError(forwarded()) -expectError(forwarded('10.0.0.1')) diff --git a/types/index.tst.ts b/types/index.tst.ts new file mode 100644 index 0000000..e0eef4e --- /dev/null +++ b/types/index.tst.ts @@ -0,0 +1,19 @@ +/// + +import { type IncomingMessage } from 'node:http' +import { expect } from 'tstyche' +import forwardedESM, { forwarded } from '.' +import * as forwardedVarImport from '.' + +expect(forwardedESM({} as IncomingMessage)).type.toBe() +expect(forwarded({} as IncomingMessage)).type.toBe() + +expect(forwardedVarImport.default({} as IncomingMessage)).type.toBe() +expect(forwardedVarImport.forwarded({} as IncomingMessage)).type.toBe< + string[] +>() + +// @ts-expect-error! +expect(forwarded()).type.toBe() +// @ts-expect-error! +expect(forwarded('10.0.0.1')).type.toBe() From 48898db2d5551e9028d3b01f8dbb59f8bcab3b71 Mon Sep 17 00:00:00 2001 From: Antonio Tripodi Date: Tue, 5 May 2026 08:57:45 +0200 Subject: [PATCH 2/2] chore: update index.tst.ts Co-authored-by: Tom Mrazauskas Signed-off-by: Antonio Tripodi --- types/index.tst.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/types/index.tst.ts b/types/index.tst.ts index e0eef4e..06f2973 100644 --- a/types/index.tst.ts +++ b/types/index.tst.ts @@ -13,7 +13,5 @@ expect(forwardedVarImport.forwarded({} as IncomingMessage)).type.toBe< string[] >() -// @ts-expect-error! -expect(forwarded()).type.toBe() -// @ts-expect-error! -expect(forwarded('10.0.0.1')).type.toBe() +expect(forwarded).type.not.toBeCallableWith() +expect(forwarded).type.not.toBeCallableWith('10.0.0.1')