SAP / karma-ui5

A Karma plugin for UI5
Apache License 2.0
69 stars 26 forks source link

Coverage not gathered? #527

Closed wozjac closed 1 year ago

wozjac commented 1 year ago

Hello,

recently I have a problem with my library project, but also took one from web and just run it: https://github.com/mauriciolauffer/openui5-model-json-crud

The coverage is empty and I can't figure out why, Mauricio also checked this: https://twitter.com/jacekwoz/status/1605180508530409472?s=20&t=zShAzOH8KC80VCFiCuD6wA

What do we miss?

matz3 commented 1 year ago

The issue seems to be caused by the server-absolute references to /resources/ e.g. in test/openui5/model/json/crud/unit/unitTests.html. This way the files are not served via the karma server (only listening to requests below /base/) which means no instrumented files are loaded, so no coverage can be tracked. Please always use relative paths to prevent such issues.

wozjac commented 1 year ago

Thanks @matz3, issue solved.