Ask coding questions

← Back to all posts
Unit test requires index.js even though I don't have it in my project
Yoav6 (0)

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.

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
Yoav6 (0)