-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow serve multiple directories as baseDir #2259
Comments
The error about the function toModule (name) {
return {
pattern: 'node_modules/' + name,
included: false
}
}
// later
files: [
toModule('angular/angular.js'),
toModule('requirejs/require.js'),
toModule('lodash/lodash.js'),
'test-main.js'
} |
with files: [
{pattern: 'node_modules/**/*.js', included: false},
'test-main.js'
} it produces next error message:
From what I understand it means that Karma Server is trying to open and listen into too many files. |
This is because that glob pattern is overly broad. IMO, that is fine, because a broad glob pattern has huge negative performance implications as well. This is one area where I think supporting has large negative ramifications for the user on the performance side, and that nothing more should be done in karma itself in regards to this area. |
Expected behavior
Allow specify a configuration option to be able to serve some directories like
node_modules
andbower_components
as base directories.This should be similar to what (browserSync baseDir)[https://www.browsersync.io/docs/options#option-server] option does. This will allow developers to use npm packages for browser unit-testing.
Actual behavior
Right now we should specify all the files coming from
node_modules
one by one. This is cumbersome. For example if we want to userequirejs
,angular
andlodash
we should do:since trying to use a glob value for node modules doesn't work, for example doing this:
throws next error:
Enviroment Details
karma.config.js
fileThe text was updated successfully, but these errors were encountered: