Enrichvia - Business Together To Make Investments

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’)

By Enrichvia WebTeam

Jobs & Education Portal

Leave a Reply

Your email address will not be published. Required fields are marked *