Skip to content
Discussion options

You must be logged in to vote

I have ran into the same problem using jest and sunk too much time into resolving it. The thing is enabling Jest ESM Support is far from straight forward and it is still experimental, so it would be nice to provide a way by the package authors to run the package with esm transpilation through jest out of the box.

Meanwhile your solution did work for me with a few additions:

// jest.config.js
const esModules = ['nuqs'].join('|')

/* eslint-disable */
export default {
  resolver: `${__dirname}/jest-resolver.js`,
  // Tell jest to transpile es modules.
  // This is usually enough for esm only packages, but since the package provides a commonjs 
  // export that always throws we have to expli…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by franky47
Comment options

You must be logged in to vote
2 replies
@franky47
Comment options

@maxmarcon
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
4 participants