Sanjay Jain
Sanjay Jain

Reputation: 3587

Jasmine dependency on browser

From Last few days I am reading and working on Jasmine.After reading it I am able to write specification (test cases) and also able to run it successfully.

I also debugged internals flow of jasmine.

As jasmine is embeded in a html file and this html file will run on browser.

I want to know any type of dependencies of jasmine on browser (any browser).

Is jasmine is using browser's script engine ? If yes how it is configured?

If any one has an idea or tutorials then please share.

Thanks in advance.

Upvotes: 0

Views: 1313

Answers (2)

Hardik Mishra
Hardik Mishra

Reputation: 14877

Official page of Jasmine says that

"It (Jasmine) does not depend on any other JavaScript frameworks. It does not require a DOM."

Jasmine needs to run inside a JavaScript interpreter/VM in order to work. Browsers are one way to do this. Jasmine will run in any browser that supports JavaScript. Jasmine has no external dependencies.

If you are using the standalone Jasmine release, you can run your specs just by loading the spec runner web page.

Upvotes: 1

Steve
Steve

Reputation: 15736

Jasmine itself does not depend on a browser or the DOM. Often it is run in some kind of browser because the code under test has a dependency on the DOM or simply because its a convenient way to get started. In that case then, yes, it is using the browser's JavaScript engine. It can be used in most modern browser that way.

However Jasmine works fine in JavaScript environments outside a browser. For example, it is one of several testing frameworks that you can use with Node.js.

Jasmine can also be used with a 'headless' browser like Phantom.js. This can speed up your tests and allow you to integrate them into a continuous integration process.

The browser itself doesn't need to be configured in any special way to run Jasmine. How you setup your tests may depend on the kind of server-side framework you are using and the way your JavaScript files are organised. Check the list of environments on the Jasmine Wiki.

Upvotes: 1

Related Questions