Is there any way to stop Karma &/or Protractor from linting files in the stream passed to it? We are using gulp, but this could probably apply to other automation tools/environments. While I am sure they are just trying to be helpful, this clogs up our console and is redundant. Worse, it can be confusing to see the same error twice.
Here is an example task:
var karma = require('karma').server;
var spawn = require('child_process').spawn;
gulp.task('tests', function() {
karma.start({
files = 'my/unit/test/files/*.spec.js',
singleRun: true
}, function(error) {
if(error) {
console.log(error);
}
});
spawn('protractor', ['--specs=my/e2e/test/files/*.e2e.js'],
{stdio: 'inherit'}
);
});
If the file "my/e2e/test/files/test.e2e.js" exists & has a JSHint error, Protractor will report the error, whether or not you also run gulp-jshint or something else.
As an example, if the file "my/e2e/test/files/test.e2e.js" looked like this:
describe('some test', function() {
);
The output of gulp tests might look like this:
... some setup...
Protractor:
[09:32:30] An error occurred during the end-to-end testing run
[09:32:30] my/e2e/test/files/test.e2e.js:3
);
^
... some Protractor tests ...
... some Karma tests ...
If the file "my/unit/test/files/test.spec.js" exists & has a JSHint error, Karma will report this error, and it will not run. For example, if the file "my/unit/test/files/test.spec.js" looks the same as "my/e2e/test/files/test.e2e.js" above, the output of gulp tests may look like this:
...some setup...
Karma (I think):
PhantomJS 1.9.8 (Linux) ERROR
SyntaxError: Parse error
at my/unit/test/files/test.spec.js
SUMMARY:
✔ 0 tests completed
...some protractor tests...
It seems that Karma fails the task and does not run if there is an error in the spec files passed to it, and Protractor will report the error but still run, and will report the error in the tasks contained in the errored file. I would rather both streams run, both sets of tests run completely, and perhaps report syntax errors in the test output. However, they should not report the syntax errors before the tests run, or after, because we already have gulp-jshint for linting files. This is just redundant, and it is twice-redundant, in the case of Protractor, if you have a linting plugin already.
So, back to my question: Is there any way to prevent Karma &/or Protractor from linting in their respective streams, separately from the output of the tests? Is there any way to get access to their respective error reporters, without changing their source code? I could always kill them both on any errors before they run, but I may want to run the tests anyway, and I would definitely want to run the other testing framework (for example, run Karma if there are syntax errors in .e2e.js files).

