You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After updating from v2.16.0 to v3.1.0, no Jest test files will execute.
/Users/ExampleUser/Downloads/my-app/node_modules/usehooks-ts/dist/index.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){import { useState, useCallback, useLayoutEffect, useEffect, useRef, useMemo } from 'react';
^^^^^^
SyntaxError: Cannot use import statement outside a module
1 | import React from 'react';> 2 | import { useBoolean } from 'usehooks-ts';
To Reproduce
This can be reproduced using the base create-react-app project, adding the usehooks-ts dependency, and then executing the base test case after importing usehooks-ts.
Setup Project
npx create-react-app my-app --template typescript
Add usehooks-ts Dependency
npm i usehooks-ts
Import the package
Modify the App.tsx file to import usehooks-ts. The hook doesn't matter, this example uses useBoolean
Describe the bug
After updating from v2.16.0 to v3.1.0, no Jest test files will execute.
To Reproduce
This can be reproduced using the base create-react-app project, adding the usehooks-ts dependency, and then executing the base test case after importing usehooks-ts.
Setup Project
Add usehooks-ts Dependency
Import the package
Modify the App.tsx file to import usehooks-ts. The hook doesn't matter, this example uses
useBoolean
Run Tests
The tests will now fail. If you comment out the import, it works as expected.
Expected behavior
Upgrading to/beyond
v3.0.0
should not impact existing projects or the execution of tests using Jest.Additional context
Likely related to #502
The text was updated successfully, but these errors were encountered: