statsig-io / react-sdk

An SDK for using Statsig Feature Management and Experimentation platform in React js clients
ISC License
6 stars 6 forks source link

Jest fails to run with SyntaxError: Unexpected token 'export' #23

Closed SinanBaymammadli closed 5 months ago

SinanBaymammadli commented 6 months ago

Describe the bug When running unit tests with jest in a default next.js application tests fail with SyntaxError: Unexpected token 'export'

Your minimal, reproducible example https://codesandbox.io/p/devbox/jest-statsig-vmkw4h

Steps to reproduce on the terminal run npm run test

Expected behavior Test should run without an error

This issue happens because of uuid dependency in statsig-js. It has been addressed in the latest version of uuid, so just updating that dependency to version 9 should be enough fix.