Open kdekooter opened 9 years ago
Now you can do it by the following way
bowerPackages: Object.keys(require('./bower.json').dependencies)
We can do some shortcut for it, but how should it look?
Also some people want to include devDependencies
as well, so I have to design an option for them.
Thanks, that will help me move ahead for now.
I'd say default to reading the dependencies from the project's bower.json
dependencies section. bowerPackages
will then be used as an override. An additional useDevDependencies: true
property would allow loading of dev deps.
I will think about solution, and maybe find something nice. And I hope some people come into this issue with a nice another idea
While interesting, this doesn't loads the dependencies of your dependencies :/
@esquevin interesting point.
Now I see only one way to resolve this: read bower_components
directory and load all modules from there.
I've solved my problem by using wiredep in the karma.conf file instead of karma-bower:
var resources = require('wiredep')();
//load all the dependencies (following all the requirements)
var files = resources.js;
//append your own files
files = files.concat([
"bower_components/angular-mocks/angular-mocks.js",
"src/app.js",
"src/components/**/*.js",
"dev/html.js",
"unit-tests/conf.js",
"unit-tests/**/*.js",
])
Then I pass files
to the files property of my karma.conf file
Nice package. It does a lot of work regarding bower dependencies. I'll try to use it somehow
Let karma-bower read the project's bower.json and load the dependencies from there, instead of defining them (again) in the karma.conf.