test(dev-server-rollup): migrate tests from mocha/chai to node:test#3096
Open
bennypowers wants to merge 1 commit into
Open
test(dev-server-rollup): migrate tests from mocha/chai to node:test#3096bennypowers wants to merge 1 commit into
bennypowers wants to merge 1 commit into
Conversation
Replace mocha/chai with node:test and node:assert/strict across all 8
test files and the shared test-helpers module. Key changes:
- describe/it from node:test, assert from node:assert/strict
- __dirname replaced with import.meta.dirname
- Source imports (../../src/) changed to dist imports (../../dist/)
- Local .js imports changed to .ts (strip-types can't resolve .js->.ts)
- this.timeout(N) converted to { timeout: N } test option
- require.resolve() in babel tests uses createRequire(import.meta.url)
- import type for type-only imports (DevServerCoreConfig, RollupPlugin)
- Test script uses quoted glob for node's built-in glob expansion
- Removed mocha and chai devDependencies
Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
__dirnamewithimport.meta.dirnamethroughout../../src/) to dist imports (../../dist/) for native type stripping compatibility.jsimports to.ts(strip-types cannot resolve.jsto.ts)this.timeout(N)to{ timeout: N }test optioncreateRequire(import.meta.url)forrequire.resolve()in babel testsimport typefor type-only imports (DevServerCoreConfig,Logger,RollupPlugin,AstNode)Pre-existing issues noticed (not fixed here)
babel.test.tsdescribe block says@rollup/plugin-aliasinstead of@rollup/plugin-babel(copy-paste error)node-resolve.test.ts:71has a leftoverconsole.log(text)debugging statementTest plan
CHROME_PATHset**recursively)