Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I confirm what version of Jasmine I'm using?

If I recall there is a command in Jasmine that will log the exact version of Jasmine I'm running to the console, but I can't remember what it is. I am positive I have seen this before somewhere, and now that I actually need it I can't find it anywhere. Does anyone know what it is?


Edit: The posted solution of using jasmine.getEnv().versionString() isn't working - to any mods reading this, would fixing that issue be better to start as a new question, or continue here?

like image 703
TheGuyWithTheFace Avatar asked Jul 09 '14 15:07

TheGuyWithTheFace


2 Answers

To simply log the version number try:

   if (jasmine.version) { //the case for version 2.0.0        console.log('jasmine-version:' + jasmine.version);     }     else { //the case for version 1.3        console.log('jasmine-version:' + jasmine.getEnv().versionString());     } 

I use this little helper function:

 this.isJasmineV2 = function () {         return (jasmine.version && jasmine.version.charAt(0) === "2");         //version 1.3 uses this syntax: jasmine.getEnv().versionString()     }; 
like image 82
Mike Avatar answered Sep 26 '22 02:09

Mike


command line command:

Detailed view:

npm view jasmine 

or

Version Number:

npm view jasmine version 
like image 21
Mike Stahl Avatar answered Sep 27 '22 02:09

Mike Stahl