Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular Mocks Version Relation With Angular's Version

While implementing Karma on an AngularJS application with version 1.3.16, the angular-mocks module throw the following error -

angular-mocks.js:Uncaught TypeError: angular.module(...).info is not a function

After googling, found that the version of Karma used i.e. 1.5.0 and the version of AngularJS are not compatible. The version of angular-mocks used is 1.6.3.

So, after googling, found that there is no way to find out which version of AngularJS is compatible with which version of Karma or Angular-Mocks. Any help is appreciated.

like image 570
Sahil Babbar Avatar asked Mar 19 '17 11:03

Sahil Babbar


People also ask

Which version of Angular is best?

Angular 14 – The Latest Version This TypeScript-based web application framework released on 2nd June 2022 is developed by Google and supports the latest TypeScript 4.7 release. As compared to its ancestral versions, Angular 14 is one of the most thoughtfully designed and holistic upgrades.

Which Angular version is a current version?

Finally, Angular 14, the latest version of the Google-developed, TypeScript-based web application framework, made its way on 2nd June 2022, with the prior success of Angular 13.

How do I install Angular mocks?

First, download the file: Google CDN e.g. "//ajax.googleapis.com/ajax/libs/angularjs/X.Y.Z/angular-mocks.js" NPM e.g. npm install [email protected].

How many versions are there in Angular?

Angular is a blanket term that is used for all the versions which came after AngularJS (Angular 1), i.e., Angular 2, Angular 4, Angular 5 and now Angular 6. It has the latest and most refined framework till date to design a web application that is dynamic and responsive.


1 Answers

The relationship is direct. They should be matched. 1.3.16 version of angular.js has to be matched with 1.3.16 versions of angular-*.js modules (including angular-mocks.js).

Obviously, if ngMock 1.6.3 uses a feature (info method) that wasn't previously implemented in core library, it will throw an error.

ngMock reference states:

First, download the file: <...> where X.Y.Z is the AngularJS version you are running.

Angular versions aren't related to Karma versions at all. Karma is just a runner, it executes tests and isn't tied to frameworks.

like image 51
Estus Flask Avatar answered Sep 27 '22 20:09

Estus Flask