rafactor: Migrate karma config files to ts and fix types in browser-test-runner#3266
Merged
Conversation
We can do that even in older node versions. Better than cjs configs, eh?
browser-test-runner
teogeb
approved these changes
Dec 8, 2025
| } | ||
| } | ||
| }, | ||
| } as Configuration |
Contributor
Author
There was a problem hiding this comment.
Yeah, by… casting the result of defaultConfig but it makes merging them configs a mess.
Contributor
Author
There was a problem hiding this comment.
Well, that's actually a "no", eh?
juslesan
approved these changes
Dec 8, 2025
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.
This pull request migrates Karma and Webpack configuration files from CommonJS/JavaScript to ES Modules/TypeScript across several packages, and improves type safety and maintainability for browser-based tests. It also refactors the
createKarmaConfigandcreateWebpackConfigAPIs to use proper Webpack types, updates custom matcher imports, and adjusts package scripts to use the new TypeScript config files.Changes
Configuration migration and refactoring:
dht,proto-rpc,sdk, andtrackerless-networkpackages from.js/CommonJS to.ts/ES Modules, updating imports and exports accordingly.createKarmaConfigandcreateWebpackConfiginbrowser-test-runnerto use proper Webpack types (Configuration,ExternalItem, etc.), improving type safety and merging external dependencies more robustly.Test setup improvements:
karma-setup.jsfiles to use ES Module syntax (importinstead ofrequire) for consistency and compatibility.Package script updates:
test-browserand related scripts inpackage.jsonfiles to use.tsconfig files instead of.js, ensuring the new TypeScript-based configs are used for browser tests.File renaming and cleanup:
.jsconfig files and replaced them with.tsequivalents where appropriate, cleaning up the codebase and reducing duplication.Webpack configuration enhancements:
aliasandfallbackfields toresolveinwebpack.config.jsto support new type definitions and ensure compatibility with the updated config factories.