Feat/improve runner#67
Merged
Merged
Conversation
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 introduces a major refactor of the test runner infrastructure, decoupling test and suite registration from the main
twdexport and moving it into a newrunnermodule. It also updates the test registry to use aMap-based handler system, introduces a newTestRunnerclass, and updates all internal and example tests to use the new API. Additionally, it exposes new subpath exports inpackage.jsonand improves plugin integration for Vite.Test runner and registry refactor:
runnermodule (src/runner.ts) that manages test and suite registration using aHandlermap, supports nested suites, and provides new APIs fordescribe,it,it.only,it.skip,beforeEach,afterEach, and test clearing. Also adds aTestRunnerclass for executing tests with proper hook and status handling.runnermodule, replacing previous registry and function usage. [1] [2] [3] [4]API and package structure changes:
package.jsonto add subpath exports for./runnerand./vite-plugin, exposing their types and builds for external consumers.src/index.tsto only exporttwdfrom the main entry, removing test runner functions and plugin exports, which are now available via subpaths.Vite plugin improvements:
removeMockServiceWorkerplugin from the new subpath.Mock Service Worker improvements:
mock-sw.jsto improve URL regex validation, response handling for special HTTP status codes, and updated logging/versioning.Test coverage updates:
.only/.skiplogic, and correct hook execution order. [1] [2] [3]Test runner and registry refactor:
runnermodule that manages test/suite registration with a map-based handler system, supports nested suites, hooks, and provides aTestRunnerclass for execution.API and package structure:
./runnerand./vite-plugininpackage.jsonfor better modularity and external usage.src/index.tsto only export the maintwdAPI, moving runner and plugin exports to subpaths.Vite and mock service worker:
mock-sw.jsfor better URL regex handling and response management.Test coverage:
.only/.skiplogic. [1] [2] [3]This closes #36