Skip to content

refactor: remove @open-wc/testing dependency#7

Closed
cristinecula wants to merge 1 commit intomasterfrom
feature/neo-930-neovicitesting-renderhook
Closed

refactor: remove @open-wc/testing dependency#7
cristinecula wants to merge 1 commit intomasterfrom
feature/neo-930-neovicitesting-renderhook

Conversation

@cristinecula
Copy link
Contributor

Summary

  • Removes @open-wc/testing dependency to enable Vitest compatibility
  • Replaces litFixtureSync with lit-html's native render function
  • Replaces waitUntil polling with Promise-based waiting mechanism

Changes

  • src/renderer.ts: Use lit-html render() to create fixture instead of litFixtureSync
  • src/render-hook.ts: Use Promise-based waiting with setTimeout(0) for effect timing instead of waitUntil
  • src/result.ts: Add pendingUpdate flag to handle sync render detection (when component renders before resolver is registered)
  • package.json: Remove @open-wc/testing from dependencies, add @esm-bundle/chai to devDependencies
  • test/render-hook.test.ts: Import expect from @esm-bundle/chai directly
  • tsconfig.json: Add skipLibCheck: true for chai type compatibility

Motivation

The @open-wc/testing package has ESM/extension issues in jsdom environments, preventing @neovici/testing from being used with Vitest. This change removes the problematic dependency while maintaining full backward compatibility.

Related

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
@cristinecula cristinecula deleted the feature/neo-930-neovicitesting-renderhook branch February 6, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant