refactor: remove @open-wc/testing dependency#7
Closed
cristinecula wants to merge 1 commit intomasterfrom
Closed
Conversation
Replace litFixtureSync and waitUntil from @open-wc/testing with native implementations using lit-html's render function and Promise-based waiting mechanism. This allows @Neovici/testing to work in both browser and jsdom environments, making it compatible with Vitest. Changes: - renderer.ts: use lit-html render() instead of litFixtureSync - render-hook.ts: use Promise-based waiting instead of waitUntil - result.ts: add pendingUpdate flag for sync render detection - package.json: remove @open-wc/testing dependency - test: use @esm-bundle/chai directly for assertions - tsconfig.json: add skipLibCheck for chai types
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
@open-wc/testingdependency to enable Vitest compatibilitylitFixtureSyncwith lit-html's nativerenderfunctionwaitUntilpolling with Promise-based waiting mechanismChanges
lit-htmlrender()to create fixture instead oflitFixtureSyncsetTimeout(0)for effect timing instead ofwaitUntilpendingUpdateflag to handle sync render detection (when component renders before resolver is registered)@open-wc/testingfrom dependencies, add@esm-bundle/chaito devDependenciesexpectfrom@esm-bundle/chaidirectlyskipLibCheck: truefor chai type compatibilityMotivation
The
@open-wc/testingpackage has ESM/extension issues in jsdom environments, preventing@neovici/testingfrom being used with Vitest. This change removes the problematic dependency while maintaining full backward compatibility.Related