efarley
efarley

Reputation: 8661

Angular 2 Materials throws warning in karma tests

Whenever I test a component that uses Angular Material inside 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 Material components may not work correctly.'

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

Couple notes: I'm using Angular CLI v. 1.0.1 with Angular Materials v. 2.0.0.beta.3

Upvotes: 3

Views: 744

Answers (1)

efarley
efarley

Reputation: 8661

I have been able to resolve this by adding the following line to the files array in karma.config.js

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

Upvotes: 3

Related Questions