The README.md says:
The .test.js / .spec.js files (or the __tests__ folders) can be located at any depth under the src top level folder.
However, if I create a .spec.js in a e2e folder at the root of the project, it is still executed by npm test

I guess that's a bug. Right now I can workaround by overriding the testPathPattern parameter in my package.json: react-scripts test --env=jsdom --testPathPattern ./src\/.*
The README.md says:
The .test.js / .spec.js files (or the __tests__ folders) can be located at any depth under the src top level folder.However, if I create a
.spec.jsin ae2efolder at the root of the project, it is still executed bynpm testI guess that's a bug. Right now I can workaround by overriding the
testPathPatternparameter in mypackage.json:react-scripts test --env=jsdom --testPathPattern ./src\/.*