Rainbow-CPaaS / StarterKit-SDKWeb-Angular2

Starter Kit for the ALE Rainbow SDK for Web based on Angular 2+ environment
2 stars 2 forks source link

unit tests not working #5

Open sebmeyer opened 4 years ago

sebmeyer commented 4 years ago

Hello,

in another project that depends on the web SDK, we have some issues running unit tests. So I cloned this repository, followed the steps in the README and am still getting the same issues we have in our own project:

An error was thrown in afterAll                                                                                                                                                                                                            
 ReferenceError: angular is not defined                                                                                                                                                                                                     
     at Object.push../node_modules/rainbow-web-sdk/src/rainbow-sdk.min.js.__webpack_exports__.default (http://localhost:9876/_karma_webpack_/node_modules/rainbow-web-sdk/src/rainbow-sdk.min.js:8:132902)                                  
     at __webpack_require__ (http://localhost:9876/_karma_webpack_/node_modules/rainbow-web-sdk/src/rainbow-sdk.min.js:1:236)                                                                                                               
     at Module.<anonymous> (http://localhost:9876/_karma_webpack_/node_modules/rainbow-web-sdk/src/rainbow-sdk.min.js:25:1422372)                                                                                                           
     at __webpack_require__ (http://localhost:9876/_karma_webpack_/node_modules/rainbow-web-sdk/src/rainbow-sdk.min.js:1:236)                                                                                                               
     at push../node_modules/rainbow-web-sdk/src/rainbow-sdk.min.js.__webpack_exports__.default (http://localhost:9876/_karma_webpack_/node_modules/rainbow-web-sdk/src/rainbow-sdk.min.js:1:1534)                                           
     at Module../node_modules/rainbow-web-sdk/src/rainbow-sdk.min.js (http://localhost:9876/_karma_webpack_/node_modules/rainbow-web-sdk/src/rainbow-sdk.min.js:1:1607)                                                                     
     at __webpack_require__ (http://localhost:9876/_karma_webpack_/webpack/bootstrap:79:1)                                                                                                                                                  
     at Module../src/app/app.component.ts (http://localhost:9876/_karma_webpack_/main.js:580:73)                                                                                                                                            
     at __webpack_require__ (http://localhost:9876/_karma_webpack_/webpack/bootstrap:79:1)                                                                                                                                                  
     at Module../src/app/app.component.spec.ts (http://localhost:9876/_karma_webpack_/main.js:531:72)                                                                                                                                       
Chrome 80.0.3987 (Windows 10.0.0): Executed 0 of 0[ERROR[(0 secs / 0 secs)

From what I could gather so far, this is because the rainbow SDK itself is built on angularjs, but our app is built on the current angular version.

Can anyone provide some insight into how we might be able to fix this? Not being able to properly execute unit tests makes developing new features a lot harder than we would like it to be.