test(test-runner): migrate integration tests from mocha/chai to node:test#3099
test(test-runner): migrate integration tests from mocha/chai to node:test#3099bennypowers wants to merge 9 commits into
Conversation
…test Migrate the shared integration test framework and all three browser launcher test wrappers (chrome, playwright, puppeteer) from mocha/chai to node:test/node:assert/strict. Changes: - integration/test-runner: chai assertions to node:assert, mocha globals to node:test imports, `__dirname` to `import.meta.dirname`, internal imports use .ts extension for strip-types - test-runner-chrome: this.timeout to describe options, src -> dist imports, integration import uses .ts extension - test-runner-playwright: same as chrome - test-runner-puppeteer: same as chrome - All test scripts: mocha -> node --experimental-strip-types --test No published code changes. All packages' src/ directories are untouched. Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ntegration tests Add local expectIncludes helper to replace assert.ok(x.includes(y)) for better error messages on failure. Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
I also migrated
On top of that, running the tests for them was not enabled, because "test:node" wasn't defined. My change also will now run those tests. I was able to verify |
|
The tests of I will disable them again now by removing "test:node". Looks like it's an issue since a long time ago, in general these packages were not tested for a long time and we need to look into solving it. |
6f94032 to
6f3301d
Compare
6f3301d to
48d4ef9
Compare
|
@bennypowers I made significant changes in the PR, see my comments above, last commits and let me know please if you are OK with them. |
Summary
integration/test-runner/framework (7 test helper files, 567 lines) from mocha/chai to node:test/node:assert/stricttest-runner-chrome,test-runner-playwright,test-runner-puppeteertest wrappersChanges per component
integration/test-runner/ (shared framework):
__dirnametoimport.meta.dirnamenode --experimental-strip-types --testtest-runner-chrome/playwright/puppeteer (wrappers):
this.timeout(N)todescribe('...', { timeout: N }, () => ...)../src/index.jsto../dist/index.js.tsextensionnode --experimental-strip-types --testNo published code changes
All packages'
src/directories are untouched. Only test files and test scripts changed.Test plan