I'm running karma test cases through gulp as below:
gulp.task('unit-test-karma', function () {
return gulp.src(filePaths.libraryPaths.concat(filePaths.codePathsVerbose.concat(filePaths.testPaths).concat(filePaths.htmlPaths).concat(filePaths.jadePaths)))
//.pipe(plumber({ errorHandler: notify.onError(function(error) { console.log(error.message); return "Karma Error"; }) }))
.pipe(karma({
configFile: './karma.conf.js',
action: 'run', // watch
singleRun: true,
reporters: [ 'dots' ]
}));
});
When I run with action as run
, IE 11 throws below error.
IE 11.0.0 (Windows 10 0.0.0) ERROR
'expect' was used when there was no current spec, this could be because an asynchronous test timed out
at C:/BbCAT-WebDI/BbCAT-Web/BbCAT-Angular/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:938
But if run the same with action as watch
then all test case executing successfully in chrome, IE and firefox.
After reading some post, It seems there is some issue with $http service call but not able to find from where exactly the problem is!
$httpBackend
in your unit tests to stub out your$http
service calls? docs.angularjs.org/api/ngMock/service/$httpBackend – Modxit
for this block and it's working fine. – Mayfield