Jasmine Intro


Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend on any other JavaScript frameworks. It does not require a DOM. And it has a clean, obvious syntax so that you can easily write tests. Protractor, uses Jasmine for its test syntax.

Basic flow: 
A test file is comprised of one or more it blocks that describe the requirements of your application. it blocks are made of commands and expectations. Commands tell Protractor to do something with the application such as navigate to a page or click on a button. Expectations tell Protractor to assert something about the application's state, such as the value of a field or the current URL. If any expectation within an it block fails, the runner marks the it as "failed" and continues on to the next block. Test files may also have beforeEach and afterEach blocks, which will be run before or after each it block regardless of whether the block passes or fails.

























 Tip:
Check Jasmine version
   cmd > npm view jasmine version

More posts coming..

Comments

Popular Posts