Skip to content
Sign upLog in
← Back to Community

Unit test requires index.js even though I don't have it in my project

Profile icon
Yoav6

I created a react project, and wanted to add some unit tests.
In 'setup' it gives a default import on the first line and lets me add new imports after it, but doesn't let me remove or edit the first import.

image

Alas, when I run the tests, they fail because it can't find 'index.js'. creating such a file in my project doesn't help, but even if it did it would be a bad solution, since I have no need for an 'index.js' file.

What can I do to fix or bypass this problem?

Voters
Profile icon
Kelsey-Steven-Ada
Profile icon
Yoav6