From bfafe6e0c27e5384ccfc4f282bb2d03d378ef09f Mon Sep 17 00:00:00 2001 From: Salah-Eddine Saakoun Date: Fri, 4 Sep 2026 15:46:17 +0200 Subject: [PATCH] fix: make the tsd type tests actually run `yarn test:types` runs bare `tsd`, which finds no test files at all. It produces no output and exits 0 no matter what, so the 460 lines of type assertions in src/*.test-d.ts have not been checking anything. Proof: appending `expectAssignable(999)` to hex.test-d.ts still exits 0. Pointing tsd at the files explicitly reports it correctly and exits 1. The cause is the `types` field. tsd resolves test files relative to it, and it has pointed at ./dist/index.d.cts since ts-bridge was adopted in #182 on 2024-04-23, which tsd 0.29 does not resolve. The `tsd.directory` setting does not compensate. There have been 26 releases since, all with this check silently passing. Fixing the invocation rather than the `types` field, since the latter is correct for consumers and only tsd is confused by it. All four existing files pass once actually executed, so nothing needed changing in them. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f9bfbb4a..5b35486b 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "prepack": "./scripts/prepack.sh", "test": "yarn test:source && yarn test:types", "test:source": "jest && jest-it-up", - "test:types": "tsd", + "test:types": "tsd --files 'src/*.test-d.ts'", "test:watch": "jest --watch" }, "dependencies": {