Open gnud opened 7 years ago
I am having these same issues
Some time passed but I've got the same issue and I found out how to run it properly.
In my case, I got Error: need $controller service {}
but testing controller instead of directive.
My fault was on the karma-unit.conf.js
I was adding my application files like this:
//Application code
'app/app.js',
'app/components/**/*-module.js',
'app/states/app-states.js',
'app/components/**/*.js',
//test files
'app/components/**/*.spec.js',
And the expression 'app/components/**/*.js',
was getting the spec files before the controllers'.
I fix it by explicitly setting the file name end like this:
//Application code
'app/app.js',
'app/states/app-states.js',
'app/components/**/*-module.js',
'app/components/**/*-controller.js',
'app/components/**/*-service.js'
//test files
'app/components/**/*.spec.js',
Finally i got it working. I hope my answer is useful for someone.
I tried running the tests using gulp watch or gulp tdd or karma start, none of tests pass. I removed all the tests and left with one test which came with the repo, but it crashed as well.
Following are the configs and logs:
The original test, which it's not different than the ./artisans ng:component mycomponent what generates as spec.js file.
I'm using Laravel 5.2 and angular 1.5.x.
package.json
bower.json
Does someone know what I made wrong ?