2

I am writing unit tests with jest, my unit tests are running but I am always getting below error. Due to this error, it does not show coverage and test description which ran successfully

console.error
      Warning: An update to MsalAuthenticationTemplate ran an effect, but 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://reactjs.org/link/wrap-tests-with-act
      at MsalProvider (C:\XXXXXX\node_modules\@azure\msal-react\src\MsalProvider.tsx:25:31)
      at ThemeProvider (C:\XXXXXX\node_modules\@material-ui\core\node_modules\@material-ui\styles\ThemeProvider\ThemeProvider.js:48:24)
      at Provider (C:\XXXXXX\node_modules\react-redux\lib\components\Provider.js:21:20)

anyone faced same issue and has the sample mocking of the MsalAuthenticationTemplate ?

Mandeep Singh
  • 1,287
  • 14
  • 34

0 Answers0