Hello-
I’ve got to Activity 3.1.2 Review Failed Checks on the foundation course for JS.
- I run npm start and it loads up the project
- npm test runs the test list- it only appears to run anything in
src/__tests__
- It looks like there are three tests running…
- examplecomponent.test.js (should pass)
- projectlist.test.js (which also should pass)
- I’ve imported login.test.js which isn’t supposed to pass (from my course notes)
I’m supposed to work out why it’s not passing.
Further to this I am getting a console error (as below)
â—Ź Console
console.error
Warning: Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.
at fn (/Users/kellykenyon/Repos/mot-cert-support-app-js/node_modules/react-router/lib/components.tsx:280:3)
at fn (/Users/kellykenyon/Repos/mot-cert-support-app-js/src/components/Login.js:6:39)
at fn (/Users/kellykenyon/Repos/mot-cert-support-app-js/node_modules/react-router/lib/components.tsx:413:13)
at fn (/Users/kellykenyon/Repos/mot-cert-support-app-js/node_modules/react-router/lib/components.tsx:219:3)
It’s also saying i’ve passed 3 suites but 4 tests- which is confusing. (screenshot attached) If anyone can explain the difference between the Suites/ Tests/ Snapshots, I’d be greatful.
I don’t think that the files under the test folder are actually testing -I’m not sure what is going on with why/ how i get them to run
I’ve added screenshots for any additional help with this. I’m a bit lost!
To be extra helpful my code can be found here
Thank you so much in advance, I’m very lost!