Skip to content

Fix/types coverage v1#82

Merged
kevinccbsg merged 5 commits into
mainfrom
fix/types-coverage-v1
Nov 12, 2025
Merged

Fix/types coverage v1#82
kevinccbsg merged 5 commits into
mainfrom
fix/types-coverage-v1

Conversation

@kevinccbsg

Copy link
Copy Markdown
Member

Description

Type of Change

Please delete options that are not relevant:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test addition or update

Changes Made

This pull request introduces several improvements and fixes related to version compatibility between the client and the mock Service Worker, expands assertion coverage in the test suite, and makes minor dependency and configuration updates.

Version compatibility and Service Worker communication:

  • Added version checking between client and Service Worker to detect mismatches and warn users with clear instructions for resolving incompatibilities. This includes sending the version in postMessage calls and displaying warnings when a mismatch is detected. (src/cli/mock-sw.js, src/commands/mockBridge.ts, examples/twd-test-app/public/mock-sw.js, src/tests/cli/mock-sw.spec.js, src/tests/commands/mockBridge/mockRequest.spec.ts, package.json) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]
  • Updated the mock Service Worker script to include version reporting and improved version mismatch handling, along with instructions for reinstallation. (examples/twd-test-app/public/mock-sw.js)

Testing improvements:

  • Added comprehensive tests for negated assertions (e.g., not.contain.text, not.be.empty, not.have.attr, not.have.value, not.be.disabled, not.be.checked, not.be.selected, not.be.focused) to improve assertion reliability and coverage. (src/tests/asserts/runAssertion.spec.ts) [1] [2] [3] [4] [5] [6] [7] [8]

Dependency and configuration updates:

  • Moved @testing-library/user-event from devDependencies to dependencies in package.json for correct installation in all environments. (package.json) [1] [2]
  • Added a .vscode/settings.json file to specify a custom Live Server port for local development. (.vscode/settings.json)

Codebase cleanup:

  • Removed legacy Service Worker version upgrade logic from initRequestMocking, simplifying the registration flow. (src/commands/mockBridge.ts, src/tests/commands/mockBridge/initMocking.spec.ts) [1] [2] [3]

Type export:

  • Exported the Chai type from the main entry point for improved TypeScript support. (src/index.ts)

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • All existing tests pass
  • New and existing unit tests pass locally
  • I have tested this change manually

Documentation

  • I have updated the documentation accordingly

Note: If your change affects the public API or adds new features, documentation updates are required.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

@kevinccbsg kevinccbsg merged commit 83bebd1 into main Nov 12, 2025
4 checks passed
@kevinccbsg kevinccbsg deleted the fix/types-coverage-v1 branch November 12, 2025 22:37
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