Skip to content

Instantly share code, notes, and snippets.

@mtreacy002
Created March 10, 2021 01:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtreacy002/cf7ea68c069c4d2be1f06d0dfed63a86 to your computer and use it in GitHub Desktop.
Save mtreacy002/cf7ea68c069c4d2be1f06d0dfed63a86 to your computer and use it in GitHub Desktop.
Error running npm test
PASS src/tests/PersonalDetails.test.js (7.322s)
● Console
console.error node_modules/react-dom/cjs/react-dom.development.js:88
Warning: An update to PersonalDetails inside a test was not wrapped in act(...).
When testing, code that causes React state updates should be wrapped into act(...):
act(() => {
/* fire events that update state */
});
/* assert on the output */
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://fb.me/react-wrap-tests-with-act
in PersonalDetails (at PersonalDetails.test.js:91)
console.error node_modules/react-dom/cjs/react-dom.development.js:88
Warning: An update to PersonalDetails inside a test was not wrapped in act(...).
When testing, code that causes React state updates should be wrapped into act(...):
act(() => {
/* fire events that update state */
});
/* assert on the output */
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://fb.me/react-wrap-tests-with-act
in PersonalDetails (at PersonalDetails.test.js:101)
console.error node_modules/jsdom/lib/jsdom/virtual-console.js:29
Error: Error: connect ECONNREFUSED 127.0.0.1:5000
at Object.dispatchError (C:\Users\maya\Documents\Devel\bridge-in-tech-web\node_modules\jsdom\lib\jsdom\living\xhr-utils.js:65:19)
at EventEmitter.<anonymous> (C:\Users\maya\Documents\Devel\bridge-in-tech-web\node_modules\jsdom\lib\jsdom\living\xmlhttprequest.js:676:20)
at EventEmitter.emit (events.js:327:22)
at Request.<anonymous> (C:\Users\maya\Documents\Devel\bridge-in-tech-web\node_modules\jsdom\lib\jsdom\living\xhr-utils.js:412:47)
at Request.emit (events.js:315:20)
at Request.onRequestError (C:\Users\maya\Documents\Devel\bridge-in-tech-web\node_modules\request\request.js:877:8)
at ClientRequestOverride.emit (events.js:315:20)
at ClientRequest.<anonymous> (C:\Users\maya\Documents\Devel\bridge-in-tech-web\node_modules\node-request-interceptor\lib\http\ClientRequest\ClientRequestOverride.js:234:35)
at ClientRequest.emit (events.js:315:20)
at Socket.socketErrorListener (_http_client.js:469:9) undefined
console.error node_modules/react-dom/cjs/react-dom.development.js:88
Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
in PersonalDetails (at PersonalDetails.test.js:91)
console.error node_modules/react-dom/cjs/react-dom.development.js:88
Warning: An update to PersonalDetails inside a test was not wrapped in act(...).
When testing, code that causes React state updates should be wrapped into act(...):
act(() => {
/* fire events that update state */
});
/* assert on the output */
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://fb.me/react-wrap-tests-with-act
in PersonalDetails (at PersonalDetails.test.js:124)
console.error node_modules/jsdom/lib/jsdom/virtual-console.js:29
Error: Error: connect ECONNREFUSED 127.0.0.1:5000
at Object.dispatchError (C:\Users\maya\Documents\Devel\bridge-in-tech-web\node_modules\jsdom\lib\jsdom\living\xhr-utils.js:65:19)
at EventEmitter.<anonymous> (C:\Users\maya\Documents\Devel\bridge-in-tech-web\node_modules\jsdom\lib\jsdom\living\xmlhttprequest.js:676:20)
at EventEmitter.emit (events.js:327:22)
at Request.<anonymous> (C:\Users\maya\Documents\Devel\bridge-in-tech-web\node_modules\jsdom\lib\jsdom\living\xhr-utils.js:412:47)
at Request.emit (events.js:315:20)
at Request.onRequestError (C:\Users\maya\Documents\Devel\bridge-in-tech-web\node_modules\request\request.js:877:8)
at ClientRequestOverride.emit (events.js:315:20)
at ClientRequest.<anonymous> (C:\Users\maya\Documents\Devel\bridge-in-tech-web\node_modules\node-request-interceptor\lib\http\ClientRequest\ClientRequestOverride.js:234:35)
at ClientRequest.emit (events.js:315:20)
at Socket.socketErrorListener (_http_client.js:469:9) undefined
PASS src/tests/Register.test.js (8.515s)
● Console
console.error node_modules/react-dom/cjs/react-dom.development.js:88
Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
in Register (at Register.test.js:127)
console.error node_modules/react-dom/cjs/react-dom.development.js:88
Warning: An update to Register inside a test was not wrapped in act(...).
When testing, code that causes React state updates should be wrapped into act(...):
act(() => {
/* fire events that update state */
});
/* assert on the output */
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://fb.me/react-wrap-tests-with-act
in Register (at Register.test.js:165)
PASS src/tests/Login.test.jsx
Test Suites: 3 passed, 3 total
Tests: 14 passed, 14 total
Snapshots: 0 total
Time: 12.448s, estimated 13s
Ran all test suites.
Watch Usage: Press w to show more.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment