Trying to run some unit tests of our Kendo components which are wrapped in Marionette Views and am getting a "kendoGrid is not a function" error, and am not sure why.
The kendo global is attached to window, and all the kendo* functions do come up as undefined in the debugger.
Here is the load order from the body of the karma debugger:
<
script
type
=
"text/javascript"
src
=
"/base/node_modules/jasmine-core/lib/jasmine-core/jasmine.js"
crossorigin
=
"anonymous"
></
script
>
<
script
type
=
"text/javascript"
src
=
"/base/node_modules/karma-jasmine/lib/boot.js"
crossorigin
=
"anonymous"
></
script
>
<
script
type
=
"text/javascript"
src
=
"/base/node_modules/karma-jasmine/lib/adapter.js"
crossorigin
=
"anonymous"
></
script
>
<
script
type
=
"text/javascript"
src
=
"/base/web-libs-common/src/main/resources/META-INF/resources/static/js/lib/jquery/jquery.js"
crossorigin
=
"anonymous"
></
script
>
<
script
type
=
"text/javascript"
src
=
"/base/web-libs-common/src/main/resources/META-INF/resources/static/js/lib/kendoui/kendo.all.js"
crossorigin
=
"anonymous"
></
script
>
<
script
type
=
"text/javascript"
src
=
"/base/node_modules/requirejs/require.js"
crossorigin
=
"anonymous"
></
script
>
<
script
type
=
"text/javascript"
src
=
"/base/node_modules/karma-requirejs/lib/adapter.js"
crossorigin
=
"anonymous"
></
script
>
<
script
type
=
"text/javascript"
src
=
"/base/test-main.js"
crossorigin
=
"anonymous"
></
script
>
jQuery does not get loaded twice, BUT setting a break point in one of the tests and then inspecting it shows another jQuery script tag in the head element which is gone after all the tests run/blow up.
My karma.conf.js, test-main.js, and require.js config are here if needed:
StackOverflow Post
Any help would be greatly appreciated!