Angular 2 Materials Throw Warning In Trials Of Karma

Whenever I test a component that uses Angular Material inside of it, I get an annoying warning in the test output that I don't know how to clean up. How do I add a stub or polyfill for HammerJS?

WARN LOG: "Could not find HammerJS. Certain Angular components may not work correctly.

WARN: "Could not find HammerJS. Certain Angular components may not work correctly.

A couple of notes: I am using Angular CLI v. 1.0.1 with Angular Materials v. 2.0.0.b.3.

+3


source to share


1 answer


I managed to solve this problem by adding the following line to the file array in the karma.config.js file



{ pattern: './node_modules/@angular/material/prebuilt-themes/indigo-pink.css', included: true, watched: true }

      

+2


source







All Articles