Including CryptoJS external library in your Angular Unit Testing
Step-1:
Include crypto js file path in Karma.config.js as given below:
Config.set[{
files:[
‘/assets/js/crypto-core.js’
]
}]
2. In your testing.spec.ts file
mention as declare CryptoJS:any;
3. expect(CryptoJS.AEM.encrypt(‘your password’, ‘your secret key’)).toEqual(mockOutput’)