From f514d2e75c771edfaee5238f286bbdce63ebdc0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurens=20St=C3=B6tzel?= Date: Wed, 22 Apr 2026 01:42:53 +0200 Subject: [PATCH] build: replace ts-mocha with mocha + ts-node/register ts-mocha is unmaintained and incompatible with mocha 11+. Drop the wrapper and invoke mocha directly with ts-node/register, which is what ts-mocha itself wrapped. Configuration lives in .mocharc.cjs so TS_NODE_PROJECT points at test/tsconfig.json. Co-Authored-By: Claude Opus 4.7 (1M context) --- .mocharc.cjs | 6 ++++++ package.json | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .mocharc.cjs diff --git a/.mocharc.cjs b/.mocharc.cjs new file mode 100644 index 0000000..c9bc100 --- /dev/null +++ b/.mocharc.cjs @@ -0,0 +1,6 @@ +process.env.TS_NODE_PROJECT = process.env.TS_NODE_PROJECT || require('path').join(__dirname, 'test/tsconfig.json'); + +module.exports = { + require: ['ts-node/register'], + extensions: ['ts'], +}; diff --git a/package.json b/package.json index 9e12d40..018a567 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ }, "scripts": { "prepublishOnly": "yarn prettier:lint && yarn build && yarn test:integration", - "test": "ts-mocha --recursive test/**/*.spec.ts", + "test": "mocha --recursive 'test/**/*.spec.ts'", "test:integration": "node test/integration/esm.mjs && node test/integration/cjs.cjs", "coverage": "nyc yarn test", "build:esm": "tsc --project tsconfig.esm.json && node -e \"require('fs').writeFileSync('dist/esm/package.json', JSON.stringify({type:'module'}))\"", @@ -48,7 +48,6 @@ "nyc": "18.0.0", "prettier": "3.8.3", "source-map-support": "0.5.21", - "ts-mocha": "11.1.0", "ts-node": "10.9.2", "typescript": "6.0.3" },