Open agibalov opened 9 years ago
Hey,
what do your tests look like?
The output from the project I was writing about in that blogpost looks more like this these days:
Nothing special:
describe('AppController', function() {
var appController;
var $scope;
var $location;
beforeEach(module('app'));
beforeEach(inject(function($controller, $rootScope, _$location_) {
$scope = $rootScope;
$location = _$location_;
appController = $controller('AppController', {
$scope: $scope,
$location: $location
});
}));
it('should say that "notes" is active when location is /notes', function() {
$location.path('/notes');
$scope.$apply();
expect($scope.isNavBarActive('notes')).toBe(true);
expect($scope.isNavBarActive('categories')).toBe(false);
});
// 3 more like this ^^^
});
@loki2302 can you show project or create stub project which reproduce this problem?
Thanks
@maksimr sure:
To run the tests: npm install && bower install && grunt fe-test
. Locally, the result is:
...
Running "karma:test" (karma) task
INFO [karma]: Karma v0.12.31 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 41.0.2272 (Linux)]: Connected on socket 0onsddvNPuRq4dm8GUnb with id 97479661
Chrome 41.0.2272 (Linux): Executed 11 of 11 SUCCESS (0.151 secs / 0.146 secs)
When running on Travis, Karma is configured to use Firefox. Outside Travis it uses Chrome. But I've already tried Firefox locally and it worked fine.
@loki2302 thaks
Seems tests are run, but report is broken
@maksimr Oh, that's good news. Any chance I can have it fixed via configuration file only?
Had the same issue (tests running but reporter says 0 out of N). Changed reporter to "dots" now says correctly N out of N.
To me, removing `restartOnFileChange: true' from my karma conf solved this error.
I'm trying to make my Karma/Angular tests work on Travis as described here, but it keeps saying that 0 tests were executed:
There's no such issue when I run the same thing locally, it reports "4 of 4". There's also a blog post by @Swizec where eventually the same result described: "Executed 0 of 114 SUCCESS" (there's a screenshot at the very end).
Here's my set up:
.travis.yml
karma.conf.js
Gruntfile.js
Did I miss something?