How to configure Karma to include global scss files for an angular-cli project?

后端 未结 5 1413
伪装坚强ぢ
伪装坚强ぢ 2020-12-19 03:33

I cannot configure angular-cli + scss + karma to test my components together. Running ng test the kamra unit tests are only including the components\' own scss

5条回答
  •  Happy的楠姐
    2020-12-19 03:52

    Angular CLI already uses node-sass if you configure it to use sass. So there is no need to install it again:

    npm install karma-scss-preprocessor --save-dev

    should be sufficient. Plus you don't have multiple versions of node-sass in your project.

    The rest of the solution of @istibekesi works like charm.

提交回复
热议问题