Skip to content
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

"watched: false" not being honored in config file. #616

Closed
joakimkarlsson opened this issue Jul 3, 2013 · 1 comment
Closed

"watched: false" not being honored in config file. #616

joakimkarlsson opened this issue Jul 3, 2013 · 1 comment

Comments

@joakimkarlsson
Copy link

Karma version: 0.8.6
OS: Windows 7 64 bit

Consider the following structure of my project:

<project-root>
│   karma.conf.js
│
├───app/
│       app.html
│       app.js
│
└───spec/
        spec.js

And the following karma.conf.js:

basePath = '';
files = [
  MOCHA,
  MOCHA_ADAPTER,
  'app/*.js',
  {pattern: 'app/*.html', included: false, served: true, watched: false},
  'spec/*.js'
];
reporters = ['progress'];
port = 9876;
runnerPort = 9100;
colors = true;
logLevel = LOG_INFO;
autoWatch = true;
browsers = ['Chrome'];
captureTimeout = 60000;
singleRun = false;

If I edit and save app/app.html while having karma watching my files, my tests will run even though the file pattern for html files states that the watcher should ignore them.

@vojtajina
Copy link
Contributor

@joakimkarlsson thanks for reporting this. I confirm this is a bug.


chokidar does not watch patterns, but directories, therefore karma watches common parent directly of each pattern. We need to check the patterns inside "ignore" function (https://github.com/karma-runner/karma/blob/master/lib/watcher.js#L47). Because fileList does not care about watched/non watched (which is correct).

joakimkarlsson pushed a commit to joakimkarlsson/karma that referenced this issue Jul 4, 2013
Includes the patterns for files to include, but not to watch, in
addition to the excludes list when creating a list of patterns
to ignore. This makes the watcher ignore patterns marked as
"watched: false" in karma's configuration file.

Closes: karma-runner#616
vojtajina added a commit to vojtajina/karma that referenced this issue Oct 21, 2013
This fix significantly improves watching performance. It tells chokidar to ignore all paths that do not match any of the watched patterns. Before we were only ignoring paths that match some of the excludes patterns. That means that even files that didn't match any of the watched patterns were still watched by chokidar and ignored on the level of `fileList`.

Note, this fix requires paulmillr/chokidar#61.

Closes karma-runner#616
vojtajina added a commit that referenced this issue Oct 21, 2013
This fix significantly improves watching performance. It tells chokidar to
ignore all paths that do not match any of the watched patterns.

Before we were only ignoring paths that match some of the excludes patterns.
That means that even files that didn't match any of the watched patterns were
still watched by chokidar and ignored on the level of `fileList`.

Note, this fix requires chokidar 0.7.0

Closes #616
vojtajina added a commit that referenced this issue Oct 21, 2013
This fix significantly improves watching performance. It tells chokidar to
ignore all paths that do not match any of the watched patterns.

Before we were only ignoring paths that match some of the excludes patterns.
That means that even files that didn't match any of the watched patterns were
still watched by chokidar and ignored on the level of `fileList`.

Note, this fix requires chokidar 0.7.0

Closes #616
vojtajina added a commit to vojtajina/karma that referenced this issue Oct 22, 2013
This fix significantly improves watching performance. It tells chokidar to
ignore all paths that do not match any of the watched patterns.

Before we were only ignoring paths that match some of the excludes patterns.
That means that even files that didn't match any of the watched patterns were
still watched by chokidar and ignored on the level of `fileList`.

Note, this fix requires chokidar 0.7.0

Closes karma-runner#616
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants