
karma test cases
Im trying to write a karma test case for the following code which im using it in my controller im my project.
playerInstance = jwplayer("myElement")
playerInstance.setup({
primary: playerPrimary,
file: videoURL,
image: videoImage,
title:title,
description:description,
tracks: [{
file:restEndPoint+caption,
label: "English",
kind: "captions",
"default": true
}],
width: '100%',
aspectratio:"16:9",
preload:"none"
});
but it fails :TypeError: 'undefined' is not a function (evaluating 'playerInstance.setup')
when i did console.log(playerInstance), it has only one function registerPlugin().it does not have other api's.
Can someone post examples of karma test cases and can you provide me solution for that.