SAP / karma-ui5

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

Uncaught ReferenceError: sap is not defined #61

Closed afrancoc2000 closed 5 years ago

afrancoc2000 commented 5 years ago

Hi,

I'm having trouble running my karma tests from grunt in linux, I'm always getting a "Uncaught ReferenceError: sap is not defined" when I run my tests, the weird thing is that from windows everything works.

This is my configuration:

karma: {
    options: {
        basePath: 'webapp',
        frameworks: ['qunit', 'openui5'],
        openui5: {
            path: 'http://sapui5.hana.ondemand.com/resources/sap-ui-core.js'
        }
        ....... 
    }
}

Do you know why it doesn't work in linux? I tried a wget and I could download the file from the web also, I found the @openui5/sap.ui.core library. Is it possible to reference this library from the path instead of the CDN?

Thanks

matz3 commented 5 years ago

From your configuration, it looks like you are using the old karma-openui5 plugin. We've renamed the plugin/project to karma-ui5. Please have a look into the Migration Guide.

Starting with v1.0.0 you can omit the path/url when using the UI5 Tooling, which is able to serve the OpenUI5 npm dependencies. This is also mentioned in the docs here: https://github.com/SAP/karma-ui5#url and you can have a look into our openui5-sample-app.

Apart from that, it seems like your CDN url is using the http protocol instead of https. This might resolve the issue.

afrancoc2000 commented 5 years ago

it worked thanks