Skip to content

v0.1.6

  • v0.1.6
  • c61bce1
  • Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
  • Choose a tag to compare

  • v0.1.6
  • c61bce1
  • Choose a tag to compare

  • Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
@samsmithyeah samsmithyeah tagged this 09 Jun 13:36
* Fix CJS/ESM dual-instance crash in test runner

When a project lacks "type": "module" in package.json, tsx loads test
files as CJS. The CJS require() of tapsmith creates a separate module
instance from the runner's ESM import, giving it its own empty
contextStack — so describe()/test() calls crash with "Cannot read
properties of undefined (reading 'suites')".

Fix by storing contextStack and activeFixtureRegistry on globalThis
so both ESM and CJS instances share the same registration state.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add Symbol.for brands for cross-instance instanceof checks

The globalThis fix solved contextStack sharing but expect() still
failed because instanceof ElementHandle/WebViewLocator returned false
across ESM/CJS module boundaries. Add Symbol.for-based brand
properties and check those as a fallback in isElementHandle() and
isWebViewLocator().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Bump version to 0.1.6 across all packages

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix bump-version.sh: don't suppress lockfile regen errors

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Use Symbol.for keys for globalThis state instead of string keys

Avoids namespace pollution and accidental enumeration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Share _softErrors and activeTraceCollector via globalThis

Without this, CJS test files would push soft assertion errors into
their own instance's array (silently lost by the ESM runner's
flushSoftErrors), and generic assertions wouldn't record trace events
because the CJS instance's collector is never set.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Assets 2
Loading