question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Test suite failed to run

See original GitHub issue

Library versions

  • react-aad-msal: ^2.3.2
  • msal: ^1.2.1

Describe the bug When I run npm run test I get an error:

 ● Test suite failed to run

    ReferenceError: regeneratorRuntime is not defined

      30 | }
      31 | 
    > 32 | export const authProvider = new MsalAuthProvider(config, authenticationParameters, options)                                                  ^

Expected behavior When I run tests, I don’t expect an error. My tests should just run successfully. I should note that failing tests are testing components which import the authProvider file. (I add some additional functionality in there to complete partially applied axios requests with bearer tokens from the acquireTokenSilent).

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

9reactions
FizzBuzz791commented, Feb 20, 2020

Just add import "regenerator-runtime"; to the file and it should solve the problem.

0reactions
brayanLcommented, Feb 19, 2020

So, what is the solution? how should look like setupTests.js file?

Read more comments on GitHub >

github_iconTop Results From Across the Web

jest: Test suite failed to run, SyntaxError: Unexpected token ...
Jest sets the env variable to test, so I had to add my presets to the env setting in .babelrc: { "plugins": ["syntax-dynamic-import", ......
Read more >
Jest test suite failed to run with v6.4.1 · Issue #1186 - GitHub
Jest test suites failed to run after upgrading log4js to v6.4.1 that uses steamroller. Test suite failed to run TypeError: Cannot read property...
Read more >
M220JS Chapter0 - Test suite failed to run - MongoDB
Hi, I am trying to run the first test npm test -t db-connection Here is the response I get: > server@1.0.0 test >...
Read more >
test suite failed to run jest encountered an unexpected token ...
test suite failed to run jest encountered an unexpected token jest failed to parse a file. this happens e.g. when your code or...
Read more >
How I Fixed The Unexpected Token Error In Jest
To put this in different terms, I'm using Jest to test a package ... So for the Jest tests to run, it first...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found