Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QUnit / OPA tests are generating console errors because of invalid use of QUnit.config.autostart = false; #10

Open
ArnaudBuchholz opened this issue Oct 4, 2023 · 1 comment

Comments

@ArnaudBuchholz
Copy link

Easy-Ui5 version:

Latest version

OS/version:

Not relevant

Browser/version (+device/version):

Not relevant

Steps to reproduce the problem:

  1. Generate an static server app with easy-ui5
  2. Serve the newly created app
  3. Open the qunit or OPA tests

What is the expected result?

Tests are executed (and they are)

What happens instead?

Depending on the server used, the The console log shows an error about QUnit being called on start while the tests are already started.
image

Any other information? (attach screenshot if possible)

The problem comes from the asynchronous loading of the unitTests.qunit module that happens asynchronously after qunit is loaded. Hence it does not prevent the startup soon enough.

data-sap-ui-oninit="module:unit/unitTests.qunit"

I would recommend inserting a small script file that synchronously prevents the tests to start like in :
https://github.com/ArnaudBuchholz/training-ui5con18-opa/blob/main/webapp/test/qunit.autostart.js

If you agree with it, I can submit a PR.

@ArnaudBuchholz
Copy link
Author

As a side note, it appears that this problem is quite common with UI5 apps, I had to tweak ui5-test-runner to be less strict on that issue. I also observed that the karma runner doesn't care about this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant