Skip to content

Commit f4620c5

Browse files
committed
chore: migrate tests from mocha/chai to node:test + node:assert
- Migrate all test files across ~20 packages to Node.js native test runner - Replace mocha describe/it/before/after with node:test equivalents - Replace chai expect/assert with node:assert/strict - Update package.json test scripts to use `node --test` - Add tsx devDependency to test-runner-core for TypeScript test execution - Move rollup-plugin-html tests from test/src/ to test/ - Replace mocha-based test files with .mjs equivalents where needed - Add changeset for browser-logs test migration Tests only — no production source code changes. Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e2af495 commit f4620c5

106 files changed

Lines changed: 4104 additions & 5160 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
"@web/browser-logs": major
3+
---
4+
5+
BREAKING: Migrate to Node.js native test runner
6+
7+
- Replace Mocha with Node.js `node:test` module
8+
- Replace Chai with Node.js `node:assert/strict`
9+
- Use Node 24's native TypeScript type stripping (enabled by default)
10+
- Update test imports for ES modules (__dirname, require)
11+
- All 41 tests passing
12+
13+
**Migration:** No API changes. Development-only breaking change.
14+
15+
**For contributors:**
16+
- Tests now use `node:test` instead of Mocha
17+
- Use `npm run test:node` to run tests
18+
- Node 24+ required for development
19+
- TypeScript test files run directly without build step

packages/browser-logs/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"name": "@web/browser-logs",
3-
"type": "module",
43
"version": "0.4.1",
54
"publishConfig": {
65
"access": "public"
@@ -18,20 +17,22 @@
1817
"exports": {
1918
".": {
2019
"types": "./index.d.ts",
21-
"default": "./dist/index.js"
20+
"import": "./index.mjs",
21+
"require": "./dist/index.js"
2222
}
2323
},
2424
"engines": {
25-
"node": ">=24.0.0"
25+
"node": ">=18.0.0"
2626
},
2727
"scripts": {
2828
"build": "tsc",
29-
"test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\",\"moduleResolution\":\"node\"}' mocha \"test/**/*.test.{ts,js,mjs,cjs}\" --require ts-node/register --reporter dot",
30-
"test:watch": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\",\"moduleResolution\":\"node\"}' mocha \"test/**/*.test.{ts,js,mjs,cjs}\" --require ts-node/register --watch --watch-files src,test"
29+
"test:node": "node --test test/**/*.test.ts",
30+
"test:watch": "node --test --watch test/**/*.test.ts"
3131
},
3232
"files": [
3333
"*.d.ts",
3434
"*.js",
35+
"*.mjs",
3536
"dist",
3637
"src"
3738
],

0 commit comments

Comments
 (0)