PatrickJS / NG6-starter

:ng: An AngularJS Starter repo for AngularJS + ES6 + Webpack
https://angularclass.github.io/NG6-starter
Apache License 2.0
1.91k stars 1.35k forks source link

Karma with jasmine throw error('No provider for "' + name + '"!') #178

Open whisher opened 7 years ago

whisher commented 7 years ago

Hello there, I'd like to use jasmine in my test suite so I installed

npm install karma-jasmine --save-dev
npm install jasmine-core --save-dev

then

frameworks: ['jasmine'],

but when I run

npm test

I've got

node_modules/di/lib/injector.js:9 throw error('No provider for "' + name + '"!');

Can you help me, please ? Thanks in advance.

samithaf commented 7 years ago

I guess you only need karma-jasmine. did you try to run the tests without jasmine-core

whisher commented 7 years ago

Thanks Samitthaf for the kind and quick reply. The jasmine-core is required but I worked it out adding

require("karma-jasmine")

to the array plugins. Thanks .

samithaf commented 7 years ago

@whisher yup you need to tell karma what are plugins you need to use ;)