47ng / nuqs

Type-safe search params state manager for React frameworks - Like useState, but stored in the URL query string.
https://nuqs.47ng.com
MIT License
4.86k stars 104 forks source link

nuqs 2 and jest compatibility issue #741

Closed oyrad closed 2 weeks ago

oyrad commented 2 weeks ago

Context

What's your version of nuqs?

2.1.1

What framework are you using?

Which version of your framework are you using?

14.2.3

Description

Testing nuqs 2 using jest throws the following error:

Test suite failed to run

This package is ESM only.
See https://github.com/47ng/nuqs/issues/691 for more details.

The linked issue is of no help.

Reproduction

  1. Install nuqs 2.x.x
  2. import { NuqsTestingAdapter } from 'nuqs/adapters/testing' in a test suite
  3. Run any test
  4. Get error

    -->

franky47 commented 2 weeks ago

See #727 and #737 for solutions. Please try that and report back.

I'll update the error link to point to an aggregate ticket.