ReferenceError: Can't find variable: JSZip in Controller.js

382 views Asked by At

I've used the JSZip.js to compress and download some files, it works fine. But while testing i keep getting an error:

ReferenceError: Can't find variable: JSZip in App/Search/DeviceController.js

The library is also in the karma.unit.conf.js declared.

var deviceCert = new JSZip();
var certBlob = new Blob([result.data.tlsCert], { type: 'application/crt;' });
deviceCert.file('DeviceCert.crt', certBlob);
deviceCert .generateAsync({ type: "blob" })
 .then(function (content) {
     $window.saveAs(content, 'CertSet.zip');
});

Controller.js code

0

There are 0 answers