from karma.con.js:
files: [
'www/lib/ionic/js/angular/angular.js',
'www/lib/ionic/js/angular/angular-animate.js',
'www/lib/ionic/js/angular/angular-sanitize.js',
'www/lib/ionic/js/angular-ui/angular-ui-router.js',
'www/lib/ionic/js/ionic.bundle.js',
'www/lib/ionic/js/ionic-angular.js',
'tests/unit/lib/angular-mocks/angular-mocks.js',
'www/js/**/*.js',
'tests/**/*.js'
],
Test Code:
describe('DealCtrl', function () {
beforeEach(module('krazy.controllers'));
var ctrl
, scope;
beforeEach(inject(function ($controller) {
scope = {};
ctrl = $controller('DealCtrl', {$scope: scope});
}));
it('should do something', function(done) {
expect(scope.dealId).toBeDefined();
});
});
Running karma start gives me the following error:
$ karma start
INFO [karma]: Karma v0.12.16 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 34.0.1847 (Mac OS X 10.9.2)]: Connected on socket jA6UYSkdnaJ-bRvoKtnS with id 23310616
Chrome 34.0.1847 (Mac OS X 10.9.2) DealCtrl should do something FAILED
Error: [$injector:modulerr] Failed to instantiate module ngMock due to:
Error: [$injector:unpr] Unknown provider: $$rAFProvider
http://errors.angularjs.org/1.2.12/$injector/unpr?p0=%24%24rAFProvider
at /Users/d/src/samples/ionic/sample/www/lib/ionic/js/ionic.bundle.js:12754:12
I looked through GitHub and couldn’t find any sample projects that use Karma for test, are there any?