0

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

3
  • Can you provide any code for that? Commented Jan 5, 2017 at 11:54
  • Controller.js added Commented Jan 5, 2017 at 12:38
  • Is the JSZip file correctly loaded ? Do you load differently files in your tests ? Do you have an AMD loader in your tests ? Commented Jan 6, 2017 at 20:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.