-
Notifications
You must be signed in to change notification settings - Fork 103
Description
Describe the bug
@asmyshlyaev177 Thanks for building this library. I would like to report an issue I'm facing related to testing components that leverage the react-horizontal-scrolling-menu. I'm able to build the app fine, it is just not working with Jest unit test.
To Reproduce
There is not issue when using the library so there is nothing to reproduce.
I suspect the issue might have something to do with the Jest transform.This is the config I have.
// A map from regular expressions to paths to transformers
transform: {
'^.+\\.(t|j)sx?$': [
'babel-jest',
{
presets: ['next/babel'],
plugins: [
'dynamic-import-node',
[
'babel-plugin-styled-components',
{
displayName: true,
preprocess: false,
fileName: false,
},
],
],
},
],
'.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2|svg)$':
'jest-transform-stub',
},
When I run the test, this is what I get SyntaxError: Cannot use import statement outside a module

Expected behavior
Successfully rendering by Jest using jsdom
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- Package Version: 4.1.0
- Platform: Next.js 12.1.0
- Assertion Lib: Jest + React Testing Library
Additional context
Someone else had anther import issue. I suspect it is somewhat related to this issue. However, I can't confirm that. Again, thanks for building the library.